﻿//*************************************************************************
//面向服务的协作式智能交通系统仿真软件SoC-ITSS v2.1 alpha
//发布单位：西北工业大学--巴黎高科MINES机器人与群智能系统联合实验室
//团队负责人：张凯龙 Zhang Kailong
//团队成员：张大方、杨安胜、王敏、谢策、王雨佳、谢尘玉等
//联系我们：kl.zhang@nwpu.edu.cn
//2012-2021
//*************************************************************************

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms.DataVisualization.Charting;
using CyberCarSimulation.RoadModel;
using CyberCarSimulation.Bean;
using CyberCarSimulation.Utils;
using CyberCarSimulation.Regulation;
using CyberCarSimulation.Simulation;
using CyberCarSimulation.Interface;
using CyberCarSimulation.Cloud;


//*******************************************************
//
//文件名(File Name):           DisplayForm.cs
//
//数据表(Tables):              nothing 
//
//作者(Author):                谢策
//
//日期(Create Date):           2017.9.3
//
//版本(Version):               Stark
//
//版本号(VersionID):           3.0
//
//修改记录(Revision History):
//
//      R1:
//          修改作者：         谢策
//          修改日期：         2017.9.3
//          修改理由：         增加参数初始化
//
//      R2:
//          修改作者：         谢策
//          修改日期：         2017.9.20
//          修改理由：         增加控件生成
//
//      R3:
//          修改作者：         谢策
//          修改日期：         2017.12.22
//          修改理由：         增加地图生成
//
//      R4:
//          修改作者：         谢策
//          修改日期：         2018.4.24
//          修改理由：         界面设计、修改
//
//      R5:
//          修改作者：         王雨佳
//          修改日期：         2018.6.24
//          修改理由：         Map上选中Intersection效果
//
//      R6:
//          修改作者：         王雨佳
//          修改日期：         2018.9.10
//          修改理由：         不同路口选择不同算法效果
//
//      R7:
//          修改作者：         谢策
//          修改日期：         2018.9.16
//          修改理由：         修改界面
//
//*******************************************************

namespace CyberCarSimulation.Interface
{
    public partial class DisplayForm : Form
    {
        [DllImport("gdi32.dll")]
        private static extern bool BitBlt(
            IntPtr hdcDest, //目标设备的句柄  
            int nXDest,     // 目标对象的左上角的X坐标  
            int nYDest,     // 目标对象的左上角的X坐标  
            int nWidth,     // 目标对象的矩形的宽度  
            int nHeight,    // 目标对象的矩形的长度  
            IntPtr hdcSrc,  // 源设备的句柄  
            int nXSrc,      // 源对象的左上角的X坐标  
            int nYSrc,      // 源对象的左上角的X坐标  
            int dwRop       // 光栅的操作值  
            );
        public const int SRCCOPY = 0xCC0020;
        [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
        public static extern IntPtr CreateCompatibleDC(IntPtr hdcPtr);
        [DllImport("gdi32.dll", ExactSpelling = true)]
        public static extern IntPtr SelectObject(IntPtr hdcPtr, IntPtr hObject);
        [DllImport("gdi32.dll", ExactSpelling = true)]
        public static extern bool DeleteDC(IntPtr hdcPtr);
        [System.Runtime.InteropServices.DllImport("gdi32.dll")]
        public static extern bool DeleteObject(IntPtr hObject);


        
        //显示路口调度算法可配置
        //private 


        //显示限速以及 当前 车道速度
        private PictureBox SpeedPictureBox1;
        private Label LimitSpeedLabel1;
        private Label CurrentSpeedLabel1;

        private PictureBox SpeedPictureBox2;
        private Label LimitSpeedLabel2;
        private Label CurrentSpeedLabel2;

        private PictureBox SpeedPictureBox3;
        private Label LimitSpeedLabel3;
        private Label CurrentSpeedLabel3;

        private PictureBox SpeedPictureBox4;
        private Label LimitSpeedLabel4;
        private Label CurrentSpeedLabel4;

        private PictureBox SpeedPictureBox5;
        private Label LimitSpeedLabel5;
        private Label CurrentSpeedLabel5;

        private PictureBox SpeedPictureBox6;
        private Label LimitSpeedLabel6;
        private Label CurrentSpeedLabel6;

        private PictureBox SpeedPictureBox7;
        private Label LimitSpeedLabel7;
        private Label CurrentSpeedLabel7;

        private PictureBox SpeedPictureBox8;
        private Label LimitSpeedLabel8;
        private Label CurrentSpeedLabel8;

        private PictureBox SpeedPictureBox9;
        private Label LimitSpeedLabel9;
        private Label CurrentSpeedLabel9;

        private PictureBox SpeedPictureBox10;
        private Label LimitSpeedLabel10;
        private Label CurrentSpeedLabel10;

        private PictureBox SpeedPictureBox11;
        private Label LimitSpeedLabel11;
        private Label CurrentSpeedLabel11;

        private PictureBox SpeedPictureBox12;
        private Label LimitSpeedLabel12;
        private Label CurrentSpeedLabel12;

        private PictureBox SpeedPictureBox13;
        private Label LimitSpeedLabel13;
        private Label CurrentSpeedLabel13;

        private PictureBox SpeedPictureBox14;
        private Label LimitSpeedLabel14;
        private Label CurrentSpeedLabel14;

        private PictureBox SpeedPictureBox15;
        private Label LimitSpeedLabel15;
        private Label CurrentSpeedLabel15;

        private PictureBox SpeedPictureBox16;
        private Label LimitSpeedLabel16;
        private Label CurrentSpeedLabel16;

        private PictureBox SpeedPictureBox17;
        private Label LimitSpeedLabel17;
        private Label CurrentSpeedLabel17;

        private PictureBox SpeedPictureBox18;
        private Label LimitSpeedLabel18;
        private Label CurrentSpeedLabel18;

        private PictureBox SpeedPictureBox19;
        private Label LimitSpeedLabel19;
        private Label CurrentSpeedLabel19;

        private PictureBox SpeedPictureBox20;
        private Label LimitSpeedLabel20;
        private Label CurrentSpeedLabel20;

        private PictureBox SpeedPictureBox21;
        private Label LimitSpeedLabel21;
        private Label CurrentSpeedLabel21;

        private PictureBox SpeedPictureBox22;
        private Label LimitSpeedLabel22;
        private Label CurrentSpeedLabel22;

        private PictureBox SpeedPictureBox23;
        private Label LimitSpeedLabel23;
        private Label CurrentSpeedLabel23;

        private PictureBox SpeedPictureBox24;
        private Label LimitSpeedLabel24;
        private Label CurrentSpeedLabel24;

        private PictureBox SpeedPictureBox25;
        private Label LimitSpeedLabel25;
        private Label CurrentSpeedLabel25;

        private PictureBox SpeedPictureBox26;
        private Label LimitSpeedLabel26;
        private Label CurrentSpeedLabel26;

        private PictureBox SpeedPictureBox27;
        private Label LimitSpeedLabel27;
        private Label CurrentSpeedLabel27;


        private PictureBox SpeedPictureBox28;
        private Label LimitSpeedLabel28;
        private Label CurrentSpeedLabel28;

        private PictureBox SpeedPictureBox29;
        private Label LimitSpeedLabel29;
        private Label CurrentSpeedLabel29;

        private PictureBox SpeedPictureBox30;
        private Label LimitSpeedLabel30;
        private Label CurrentSpeedLabel30;

        private PictureBox SpeedPictureBox31;
        private Label LimitSpeedLabel31;
        private Label CurrentSpeedLabel31;

        private PictureBox SpeedPictureBox32;
        private Label LimitSpeedLabel32;
        private Label CurrentSpeedLabel32;

        private PictureBox SpeedPictureBox33;
        private Label LimitSpeedLabel33;
        private Label CurrentSpeedLabel33;

        private PictureBox SpeedPictureBox34;
        private Label LimitSpeedLabel34;
        private Label CurrentSpeedLabel34;

        //界面中显示车道内车辆的信息
        private Label LaneIntersection1Label1;
        private Label LaneIntersection1Label2;
        private Label LaneIntersection1Label3;
        private Label LaneIntersection1Label4;
        private Label LaneIntersection2Label1;
        private Label LaneIntersection2Label2;
        private Label LaneIntersection2Label3;
        private Label LaneIntersection2Label4;
        private Label LaneIntersection3Label1;
        private Label LaneIntersection3Label2;
        private Label LaneIntersection3Label3;
        private Label LaneIntersection3Label4;
        private Label LaneIntersection4Label1;
        private Label LaneIntersection4Label2;
        private Label LaneIntersection4Label3;
        private Label LaneIntersection4Label4;
        private Label LaneIntersection5Label1;
        private Label LaneIntersection5Label2;
        private Label LaneIntersection5Label3;
        private Label LaneIntersection5Label4;
        private Label LaneIntersection6Label1;
        private Label LaneIntersection6Label2;
        private Label LaneIntersection6Label3;
        private Label LaneIntersection6Label4;  


        //界面中控件
        private Panel BackgroundPanel;              //存放地图界面的Panel
        private Panel ControlPanel;                 //存放控件界面Panel

        //界面的菜单栏
        private MenuStrip MenuStripPanel;           //菜单栏
        private int MenuHight = 25;                 //菜单栏的高度
        private ToolStripMenuItem Menu1Layer;       //一级菜单1
        private ToolStripMenuItem Menu1LayerItem1;  //一级菜单下Item1
        private ToolStripMenuItem Menu1LayerItem2;  //一级菜单下Item2
        private ToolStripMenuItem Menu2Layer;       //一级菜单2

        private ToolStripMenuItem Menu3LayerItem1;  //一级菜单3下Item1
        private ToolStripMenuItem Menu3LayerItem2;  //一级菜单3下Item2
        private ToolStripMenuItem Menu3Layer;       //一级菜单3
        //覆盖在Intersection上的Picture
        private int PictureCountTime = 10;
        


        //Control菜单栏的Group组件
        private GroupBox VehicleParametersGroup;    //存放车辆信息的组件
        private GroupBox AgentSchedualGroup;        //存放Agent策略的组件       
        private GroupBox GlobalSchedualGroup;       //存放全局策略的组件
        private GroupBox InformationDisplayGroup;   //存放VI/II消息显示组件
        private GroupBox FunctionButtonGroup;       //存放按钮的组件
        private GroupBox ChartDiagramGroup;         //存放框图的组件
        private GroupBox AgentInformationGroup;     //存放Agent信息的组件
        //private GroupBox InterfaceConfigGroup;      //控制界面的显示
        //private GroupBox SoftwareVersionGroup;    //存放软件版本信息



        private Label VehicleID;                //车辆ID的lable
        private TextBox VehicleIDTX;            //车辆ID的TextBox
        private Label VehicleType;              //车辆类型Label
        private TextBox VehicleTypeTX;          //车辆类型TextBox
        private Label VehicleSpeed;             //车辆速度Label
        private TextBox VehicleSpeedTX;         //车辆速度TextBox
        private Label VehiclePath;              //车辆路径Label
        private TextBox VehiclePathTX;          //车辆路径TextBox;
        private Label VehicleLane;              //车辆车道Label
        private TextBox VehicleLaneTX;          //车辆车道TextBox
        private Label VehicleIntersection;      //车辆路口Label
        private TextBox VehicleIntersectionTX;  //车辆路口TextBoX
        private Label VehicleFrontCar;          //车辆前车Label
        private TextBox VehicleFrontCarTX;      //车辆前车TextBox
        private Label VehicleAccSpeed;          //车辆加速度Label
        private TextBox VehicleAccSpeedTX;      //车辆加速度TextBox


        //显示路口序号
        private PictureBox IntersectionPictureBox1;
        private PictureBox IntersectionPictureBox2;
        private PictureBox IntersectionPictureBox3;
        private PictureBox IntersectionPictureBox4;
        private PictureBox IntersectionPictureBox5;
        private PictureBox IntersectionPictureBox6;


        //显示路口的调度算法
        private Label IntersectionPolicy1;
        private Label IntersectionPolicy2;
        private Label IntersectionPolicy3;
        private Label IntersectionPolicy4;
        private Label IntersectionPolicy5;
        private Label IntersectionPolicy6;


        //路口调度算法
        //private CheckBox FAFPSV;
        //private CheckBox FAFPSQ;
        //private CheckBox FAFPSQSV;
        //private CheckBox FAFPMQ;
        //private CheckBox HQEPSV;
        //private CheckBox HWFPMQ;
        //private CheckBox HWFPSQSV;
        //private CheckBox HWFPSQ;        
        //private CheckBox SelectAll;



        private Label VehicleNumTxt;                  //选择授权数量Text
        private ComboBox VehicleNums;                 //选择授权数量下拉框

        private Label IntersectionSerialNumberTxt;    //选择路口Text
        private ComboBox IntersectionSerialNumber;    //选择路口下拉菜单

        private Label IntersectionPolicyTxt;          //选择策略Text
        private ComboBox IntersectionPolicy;          //选择策略下拉框
         
        private Button ApplyButton;                   //策略应用按钮
        private Button ResetButton;                   //策略重置按钮

        


        private CheckBox DijsktraS;     //静态迪杰斯特拉
        private CheckBox DijsktraD;     //动态迪杰斯特拉       

        //private CheckBox AntColony;     //蚁群算法
        //private CheckBox Genetic;       //遗传算法
       
        private CheckBox ShowVI;        //是否显示车辆信息
        private CheckBox ShowII;        //是否显示路口授权信息


        private Button StartButton;        //开始按钮
        private Button SuspendButton;      //暂停按钮
        private Button ExportButton;
        private Button ImportButton;
       // private Button AboutButton;
        private Button RecordDataButton;
        private Button PlaybackButton;
       // private Button SpeedShowButton;


        private Chart SpeedChart;                          //显示速度的框图
        private ChartArea chartArea2 = new ChartArea();
        private Legend legend2 = new Legend();
        private Series series2 = new Series();
        private int SpeedChartPointsNum = 400;           //速度显示区所能显示最多的点数
        private double[] SpeedPoints = new double[400];  //存储速度显示区的点 

        private Chart Accchart;
        private ChartArea chartArea1 = new ChartArea();
        private Legend legend1 = new Legend();
        private Series series1 = new Series();
        private int AccChartPointsNum = 400;           //加速度显示区所能显示最多的点数
        private double[] AccPoints = new double[400];  //存储加速度显示区的点 


        //显示路口的授权信息
        private Label AgentNumberLabel;
        //private Label AuthrizeLabel;
        private TextBox AuthrizeTextBox;
   
        //显示软件版本信息
        private Label SoftwareVersionIDLabel;
        private Label SoftwareVersionNameLabel;
        private Label SoftwareVersionCopyrightLabel;
        private PictureBox SoftwarePictureBox;

                
        //用来绘制地图背景
        private Bitmap BackgroundBitmap;
        private Graphics MapGraphics;
        public readonly float Ratio = 5.0f;  //地图的显示比例
        Rectangle rect;// = new Rectangle(0, 0, 932, 932);
        SolidBrush brush_low = new SolidBrush(Color.Lime);  //lime(low priority) red(high priority)
        SolidBrush brush_become_low = new SolidBrush(Color.SeaGreen);

        SolidBrush brush_high = new SolidBrush(Color.Red);
        SolidBrush brush_become_high = new SolidBrush(Color.Firebrick);

        SolidBrush brush_mid = new SolidBrush(Color.Yellow);
        SolidBrush brush_become_mid = new SolidBrush(Color.Goldenrod);

        //三个线程
        private static Thread SimulationThread = null;          //仿真线程,同时负责整个界面的显示，包括背景、车辆
        private static Thread ProgressBarThread = null;         //进度条线程，负责进度条的更新
        private static Thread StartGettingDataThread = null;    //获取数据线程
        private ManualResetEvent resetEvent = new ManualResetEvent(true);
        private Main MainSim = null;

        
        //绘制小车
        private Queue<Coordinate.gui_coordinate> coordinates;     //用于存储车辆的显示信息，坐标未进行比例尺转换
        private Queue<Coordinate.coordinate_i> Coordinates_i;     //用于存储车辆的显示信息，坐标进行比例尺转换
        private Queue<Coordinate.coordinate_i> Coordinates_whole; //用于存储车辆的全局坐标


        private string SelectedID = null;               //被选中车辆的ID
        private string CurSelectedID = null;            //但前所选择车辆
        private string PreSelectedID = null;            //之前所选择车辆
        private bool isSelectedVehicleInQueue = false;  //所选车辆是否在队列中，需更新


        private int CurSelectedIntersection;            //被选中的路口，用于显示该路口的授权信息

        public DisplayForm()
        {
            InitializeComponent();  //初始化控件
            InitializeData();       //初始化数据变量
            ConfigDisplayForm();
            //ConfigAlgorithm();     //配置每一个路口用的算法
        }

        //设置每一个路口所用的方法
        //界面上可配置，每一个路口方法
        //private void ConfigAlgorithm() 
        //{
        //    MainData.Algorithm.Add("FAFP-SV");
        //    MainData.Algorithm.Add("FAFP-MQ");
        //    MainData.Algorithm.Add("FAFP-MQ");
        //    MainData.Algorithm.Add("HWFP-SQ");
        //    MainData.Algorithm.Add("HWFP-SQ-SV");
        //    MainData.Algorithm.Add("HWFP-SQ-SV");
        //}

        //初始化数据
        private void InitializeData()
        {           
            this.coordinates = new Queue<Coordinate.gui_coordinate>();
            this.Coordinates_i = new Queue<Coordinate.coordinate_i>();
        }

        //绘制整个软件的界面
        private void ConfigDisplayForm()
        {
            MainData.FormConfig = new FormConfig(); //系统Form初始化          


            ConfigDisplayFormPanel();       //设置整个界面
            ConfigMenuForm();               //设置顶部菜单栏
            ConfigDisplayFormGroupBox();    //设置右侧控制菜单界面  

            
            ConfigLaneText();               //设置显示Lane上车辆信息
            ConfigLaneSpeed();              //设置显示Lane上车道速度信息
            ConfigIntersectionNumber();     //设置显示路口序号
            ConfigIntersectionPolicy();     //设置显示路口信息
       
            ConfigParametersGroup();        //设置车辆属性Label界面
            ConfigAgentGroup();             //设置车辆属性Agent界面
            ConfigGlobalGroup();            //设置车辆属性Global界面
            ConfigInformationGroup();       //设置信息显示InformationDisplay界面
            ConfigButtonGroup();            //设置按钮Button界面
            ConfigDiagramGroup();           //设置框图Diagram界面
            ConfigAgentInformationGroup();  //设置路口授权的信息
            ConfigSoftwareVersionGroup();   //设置软件版本信息

            //ConfigAgentGroup();

            //ConfigDisplayFormButtonGroup();
        }

        //设置路口显示的总体布局，动态生成各种控件
        //整个界面两部分  BackgroundPanel设置地图背景
        //                ControlPanel设置旁边控件             
        private void ConfigDisplayFormPanel()
        {
            //设置整个windows界面的长宽
            this.Width = MainData.Map.GetWidth() + 380;
            this.Height = MainData.Map.GetHeight() + MenuHight+35;
            //设置Display属性 
            this.Text = "SoC-ITSS v2.1          NPU-MINES ParisTech Joint Labortatory for Robot and Swarm Intelligent Systems";
           
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
            //this.Padding = new Padding(50, 0, 0, 0);

            this.PictureTimer.Interval = 150;  //设置定时器 步长 即0.2秒

            //在windows界面之上，创建一个菜单栏
            MenuStripPanel = new MenuStrip();
            MenuStripPanel.Width = MainData.Map.GetWidth();
            MenuStripPanel.Height = MenuHight;
            unchecked
            {
                MenuStripPanel.BackColor = Color.FromArgb((int)0xff4b4b4b);
            }
            //MenuStripPanel.BackColor = Color.FromArgb(0x664B4B4B);
            //MenuStripPanel.BackColor = System.Drawing.Color.LightBl
            this.Controls.Add(MenuStripPanel);


            //在windows界面之上，创建一个背景Panel
            BackgroundPanel = new Panel();
            BackgroundPanel.Width = MainData.Map.GetWidth();
            BackgroundPanel.Height = MainData.Map.GetHeight() + MenuHight;
            //BackgroundPanel.BackColor = System.Drawing.Color.White;
            BackgroundPanel.BackgroundImage = new Bitmap(MainData.Map.GetMapImageURL());
            BackgroundPanel.Location = new System.Drawing.Point(0, MenuHight);
            //BackgroundPanel.Location = new System.Drawing.Point(380, MenuHight);
            this.Controls.Add(BackgroundPanel);

            //在Windows界面之上，创建一个放控件的Panel
            ControlPanel = new Panel();
            ControlPanel.Width = 380;
            ControlPanel.Height = MainData.Map.GetHeight() + MenuHight;
            //ControlPanel.BackColor = Color.FromArgb(0xF0F0F0);
            unchecked
            {
                ControlPanel.BackColor = Color.FromArgb((int)0xb3f2f2f2);
            }
            ControlPanel.Location = new System.Drawing.Point(MainData.Map.GetWidth(), MenuHight);
            this.Controls.Add(ControlPanel);

            //在BackgroundPanel上注册点击事件 ******判断鼠标移动位置，触发对应的函数
            this.BackgroundPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.DisplayPanel_MouseMove);
            this.BackgroundPanel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.SelectIntersectionClick);

        }

        //配置顶部菜单栏
        private void ConfigMenuForm() 
        {
            //一级菜单栏1下的Item1
            Menu1LayerItem1 = new ToolStripMenuItem();
            Menu1LayerItem1.Size = new System.Drawing.Size(152, 22);
            Menu1LayerItem1.Text = "Item1";

            //一级菜单栏1下的Item1
            Menu1LayerItem2 = new ToolStripMenuItem();
            Menu1LayerItem2.Size = new System.Drawing.Size(152, 22);
            Menu1LayerItem2.Text = "Item2";


            //一级菜单栏1
            Menu1Layer = new ToolStripMenuItem();
            Menu1Layer.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.Menu1LayerItem1,
            this.Menu1LayerItem2});
            Menu1Layer.ForeColor = System.Drawing.Color.White;
            Menu1Layer.Size = new System.Drawing.Size(60, 21);
            Menu1Layer.Text = "File";

            //一级菜单栏2
            Menu2Layer = new ToolStripMenuItem();
            Menu2Layer.ForeColor = System.Drawing.Color.White;
            Menu2Layer.Size = new System.Drawing.Size(60, 21);
            Menu2Layer.Text = "Windows";


            //一级菜单栏1下的Item1
            Menu3LayerItem1 = new ToolStripMenuItem();
            Menu3LayerItem1.Size = new System.Drawing.Size(152, 22);
            Menu3LayerItem1.Text = "About SoC-ITSS v2.1";
            Menu3LayerItem1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Menu3LayerItem1_MouseDown);


            //一级菜单栏1下的Item1
            Menu3LayerItem2 = new ToolStripMenuItem();
            Menu3LayerItem2.Size = new System.Drawing.Size(152, 22);
            Menu3LayerItem2.Text = "About Us";
            Menu3LayerItem2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Menu3LayerItem2_MouseDown);

            //一级菜单栏3
            Menu3Layer = new ToolStripMenuItem();
            Menu3Layer.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.Menu3LayerItem1,
            this.Menu3LayerItem2});
            Menu3Layer.ForeColor = System.Drawing.Color.White;
            Menu3Layer.Size = new System.Drawing.Size(60, 21);
            Menu3Layer.Text = "Help";


            //将一级菜单 添加到菜单栏
            MenuStripPanel.SuspendLayout();
            MenuStripPanel.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.Menu1Layer,this.Menu2Layer,this.Menu3Layer});
            this.MenuStripPanel.ResumeLayout(false);
            this.MenuStripPanel.PerformLayout();


        }


        //配置显示路口序号
        private void ConfigIntersectionNumber() 
        {
            IntersectionPictureBox1 = new PictureBox();
            IntersectionPictureBox1.Size = new Size(48, 48);//设置大小
            IntersectionPictureBox1.Location = new System.Drawing.Point(500, 390);
            string MapUrl = MainData.Map.GetMapImageURL();
            string LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\IntersectionNum1.png";
            IntersectionPictureBox1.Image = Image.FromFile(LogoUrl);
            IntersectionPictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(IntersectionPictureBox1);


            IntersectionPictureBox2 = new PictureBox();
            IntersectionPictureBox2.Size = new Size(48, 48);//设置大小
            IntersectionPictureBox2.Location = new System.Drawing.Point(500 + 935, 390);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\IntersectionNum2.png";
            IntersectionPictureBox2.Image = Image.FromFile(LogoUrl);
            IntersectionPictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(IntersectionPictureBox2);


            IntersectionPictureBox3 = new PictureBox();
            IntersectionPictureBox3.Size = new Size(48, 48);//设置大小
            IntersectionPictureBox3.Location = new System.Drawing.Point(500 + 935 + 935, 390);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\IntersectionNum3.png";
            IntersectionPictureBox3.Image = Image.FromFile(LogoUrl);
            IntersectionPictureBox3.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(IntersectionPictureBox3);


            IntersectionPictureBox4 = new PictureBox();
            IntersectionPictureBox4.Size = new Size(48, 48);//设置大小
            IntersectionPictureBox4.Location = new System.Drawing.Point(500, 390 + 935);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\IntersectionNum4.png";
            IntersectionPictureBox4.Image = Image.FromFile(LogoUrl);
            IntersectionPictureBox4.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(IntersectionPictureBox4);



            IntersectionPictureBox5 = new PictureBox();
            IntersectionPictureBox5.Size = new Size(48, 48);//设置大小
            IntersectionPictureBox5.Location = new System.Drawing.Point(500 + 935, 390 + 935);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\IntersectionNum5.png";
            IntersectionPictureBox5.Image = Image.FromFile(LogoUrl);
            IntersectionPictureBox5.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(IntersectionPictureBox5);


            IntersectionPictureBox6 = new PictureBox();
            IntersectionPictureBox6.Size = new Size(48, 48);//设置大小
            IntersectionPictureBox6.Location = new System.Drawing.Point(500 + 935 + 935, 390 + 935);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\IntersectionNum6.png";
            IntersectionPictureBox6.Image = Image.FromFile(LogoUrl);
            IntersectionPictureBox6.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(IntersectionPictureBox6);
        }

        //显示路口信息 如：调度策略
        private void ConfigIntersectionPolicy()
        {
            IntersectionPolicy1 = new Label();
            IntersectionPolicy1.Text = "";
            IntersectionPolicy1.Size = new Size(190, 40);//设置大小
            IntersectionPolicy1.Location = new System.Drawing.Point(548, 400);
            IntersectionPolicy1.BackColor = Color.Transparent;
            IntersectionPolicy1.Font = new System.Drawing.Font("微软雅黑", 16F, FontStyle.Bold);
            IntersectionPolicy1.ForeColor = Color.FromArgb((int)0x4a6bee); //颜色
            BackgroundPanel.Controls.Add(IntersectionPolicy1);


            IntersectionPolicy2 = new Label();
            IntersectionPolicy2.Text = "";
            IntersectionPolicy2.Size = new Size(190, 40);//设置大小
            IntersectionPolicy2.Location = new System.Drawing.Point(548 + 935, 400);
            IntersectionPolicy2.BackColor = Color.Transparent;
            IntersectionPolicy2.Font = new System.Drawing.Font("微软雅黑", 16F, FontStyle.Bold);
            IntersectionPolicy2.ForeColor = Color.FromArgb((int)0x4a6bee); //颜色
            BackgroundPanel.Controls.Add(IntersectionPolicy2);


            IntersectionPolicy3 = new Label();
            IntersectionPolicy3.Text = "";
            IntersectionPolicy3.Size = new Size(190, 40);//设置大小
            IntersectionPolicy3.Location = new System.Drawing.Point(548 + 935 + 935, 400);
            IntersectionPolicy3.BackColor = Color.Transparent;
            IntersectionPolicy3.Font = new System.Drawing.Font("微软雅黑", 16F, FontStyle.Bold);
            IntersectionPolicy3.ForeColor = Color.FromArgb((int)0x4a6bee); //颜色
            BackgroundPanel.Controls.Add(IntersectionPolicy3);


            IntersectionPolicy4 = new Label();
            IntersectionPolicy4.Text = "";
            IntersectionPolicy4.Size = new Size(190, 40);//设置大小
            IntersectionPolicy4.Location = new System.Drawing.Point(548, 400 + 935);
            IntersectionPolicy4.BackColor = Color.Transparent;
            IntersectionPolicy4.Font = new System.Drawing.Font("微软雅黑", 16F, FontStyle.Bold);
            IntersectionPolicy4.ForeColor = Color.FromArgb((int)0x4a6bee); //颜色
            BackgroundPanel.Controls.Add(IntersectionPolicy4);


            IntersectionPolicy5 = new Label();
            IntersectionPolicy5.Text = "";
            IntersectionPolicy5.Size = new Size(190, 40);//设置大小
            IntersectionPolicy5.Location = new System.Drawing.Point(548 + 935, 400 + 935);
            IntersectionPolicy5.BackColor = Color.Transparent;
            IntersectionPolicy5.Font = new System.Drawing.Font("微软雅黑", 16F, FontStyle.Bold);
            IntersectionPolicy5.ForeColor = Color.FromArgb((int)0x4a6bee); //颜色
            BackgroundPanel.Controls.Add(IntersectionPolicy5);


            IntersectionPolicy6 = new Label();
            IntersectionPolicy6.Text = "";
            IntersectionPolicy6.Size = new Size(190, 40);//设置大小
            IntersectionPolicy6.Location = new System.Drawing.Point(548 + 935 + 935, 400 + 935);
            IntersectionPolicy6.BackColor = Color.Transparent;
            IntersectionPolicy6.Font = new System.Drawing.Font("微软雅黑", 16F, FontStyle.Bold);
            IntersectionPolicy6.ForeColor = Color.FromArgb((int)0x4a6bee); //颜色
            BackgroundPanel.Controls.Add(IntersectionPolicy6);
        }


        //配置ControlPanel中的每一个控件组件GroupBox
        private void ConfigDisplayFormGroupBox()
        {
            //存放车辆信息的组件
            VehicleParametersGroup = new GroupBox();
            VehicleParametersGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            VehicleParametersGroup.Text = "Vehicle Parameters";
            VehicleParametersGroup.Width = 340;
            VehicleParametersGroup.Height = 340;
            VehicleParametersGroup.Location = new System.Drawing.Point(10, 10);
            ControlPanel.Controls.Add(VehicleParametersGroup);

            //存放Agent策略信息的组件  
            AgentSchedualGroup = new GroupBox();
            AgentSchedualGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            AgentSchedualGroup.Text = "Agent Policy";
            AgentSchedualGroup.Width = 340;
            AgentSchedualGroup.Height = 230;
            AgentSchedualGroup.Location = new System.Drawing.Point(10, 380);
            ControlPanel.Controls.Add(AgentSchedualGroup);

            //存放车辆信息的组件
            GlobalSchedualGroup = new GroupBox();
            GlobalSchedualGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            GlobalSchedualGroup.Text = "Path-Plan Algorithm";
            GlobalSchedualGroup.Width = 340;
            GlobalSchedualGroup.Height = 80;
            GlobalSchedualGroup.Location = new System.Drawing.Point(10, 640);
            ControlPanel.Controls.Add(GlobalSchedualGroup);

            //存放VI/II消息显示的组件
            InformationDisplayGroup = new GroupBox();
            InformationDisplayGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            InformationDisplayGroup.Text = "Information Display";
            InformationDisplayGroup.Width = 340;
            InformationDisplayGroup.Height = 80;
            InformationDisplayGroup.Location = new System.Drawing.Point(10, 750);
            ControlPanel.Controls.Add(InformationDisplayGroup);

            //存放按钮的组件
            FunctionButtonGroup = new GroupBox();
            FunctionButtonGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            FunctionButtonGroup.Text = "Control";
            FunctionButtonGroup.Width = 340;
            FunctionButtonGroup.Height = 230;
            FunctionButtonGroup.Location = new System.Drawing.Point(10, 860);  
            ControlPanel.Controls.Add(FunctionButtonGroup);

            //存放框图的组件
            ChartDiagramGroup = new GroupBox();
            ChartDiagramGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            ChartDiagramGroup.Text = "Velocity profile";
            ChartDiagramGroup.Width = 340;
            ChartDiagramGroup.Height = 420;
            ChartDiagramGroup.Location = new System.Drawing.Point(10, 1120);
            ControlPanel.Controls.Add(ChartDiagramGroup);

            //存放界面控制
            //InterfaceConfigGroup = new GroupBox();
            //InterfaceConfigGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            //InterfaceConfigGroup.Text = "Interface Config";
            //InterfaceConfigGroup.Width = 340;
            //InterfaceConfigGroup.Height = 100;
            //InterfaceConfigGroup.Location = new System.Drawing.Point(10, 1520);
            //ControlPanel.Controls.Add(InterfaceConfigGroup);

            //存放Agent路口授权信息
            AgentInformationGroup = new GroupBox();
            AgentInformationGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            AgentInformationGroup.Text = "Information of Intersection";
            AgentInformationGroup.Width = 340;
            AgentInformationGroup.Height = 280;
            AgentInformationGroup.Location = new System.Drawing.Point(10, 1570);
            ControlPanel.Controls.Add(AgentInformationGroup);
                     


            ////存放software信息
            //SoftwareVersionGroup = new GroupBox();
            //SoftwareVersionGroup.Font = new Font("宋体", 14f, FontStyle.Bold);
            //SoftwareVersionGroup.Text = "SoftWareVersion";
            //SoftwareVersionGroup.Width = 290;
            //SoftwareVersionGroup.Height = 125;
            //SoftwareVersionGroup.Location = new System.Drawing.Point(10, 1795);
            //ControlPanel.Controls.Add(SoftwareVersionGroup);
        }

        
        
        //配置车辆各Label
        private void ConfigParametersGroup() 
        {
            //控件Group上放置Label
            VehicleID = new Label();
            VehicleID.Text = "VehicleID";
            VehicleID.Size = new Size(130, 20);//设置大小
            VehicleID.Location = new System.Drawing.Point(30, 30);
            VehicleParametersGroup.Controls.Add(VehicleID);


            //控件Panel上放置Label
            VehicleType = new Label();
            VehicleType.Text = "VehicleX";
            VehicleType.Size = new Size(130, 20);//设置大小
            VehicleType.Location = new System.Drawing.Point(180, 30);
            VehicleParametersGroup.Controls.Add(VehicleType);

            //控件Group上放TextBox
            VehicleIDTX = new TextBox();
            VehicleIDTX.Enabled = false;
            VehicleIDTX.Text = "";
            VehicleIDTX.Size = new Size(130, 20);//设置大小
            VehicleIDTX.Location = new System.Drawing.Point(30, 55);
            VehicleParametersGroup.Controls.Add(VehicleIDTX);

            //控件Group上放TextBox
            VehicleTypeTX = new TextBox();
            VehicleTypeTX.Enabled = false;
            VehicleTypeTX.Text = "";
            VehicleTypeTX.Size = new Size(130, 20);//设置大小
            VehicleTypeTX.Location = new System.Drawing.Point(180, 55);
            VehicleParametersGroup.Controls.Add(VehicleTypeTX);

            VehicleSpeed = new Label();
            VehicleSpeed.Text = "VSpeed";
            VehicleSpeed.Size = new Size(130, 20);//设置大小
            VehicleSpeed.Location = new System.Drawing.Point(30, 105);
            VehicleParametersGroup.Controls.Add(VehicleSpeed);

            VehiclePath = new Label();
            VehiclePath.Text = "VPath";
            VehiclePath.Size = new Size(130, 20);//设置大小
            VehiclePath.Location = new System.Drawing.Point(180, 105);
            VehicleParametersGroup.Controls.Add(VehiclePath);

            VehicleSpeedTX = new TextBox();
            VehicleSpeedTX.Enabled = false;
            VehicleSpeedTX.Text = "";
            VehicleSpeedTX.Size = new Size(130, 20);//设置大小
            VehicleSpeedTX.Location = new System.Drawing.Point(30, 130);
            VehicleParametersGroup.Controls.Add(VehicleSpeedTX);

            VehiclePathTX = new TextBox();
            VehiclePathTX.Enabled = false;
            VehiclePathTX.Text = "";
            VehiclePathTX.Size = new Size(130, 20);//设置大小
            VehiclePathTX.Location = new System.Drawing.Point(180, 130);
            VehicleParametersGroup.Controls.Add(VehiclePathTX);
            

            VehicleLane = new Label();
            VehicleLane.Text = "VLane";
            VehicleLane.Size = new Size(130, 20);//设置大小
            VehicleLane.Location = new System.Drawing.Point(30, 180);
            VehicleParametersGroup.Controls.Add(VehicleLane);

            VehicleIntersection = new Label();
            VehicleIntersection.Text = "VIntersec";
            VehicleIntersection.Size = new Size(130, 20);//设置大小
            VehicleIntersection.Location = new System.Drawing.Point(180, 180);
            VehicleParametersGroup.Controls.Add(VehicleIntersection);
            
            VehicleLaneTX = new TextBox();
            VehicleLaneTX.Enabled = false;
            VehicleLaneTX.Text = "";
            VehicleLaneTX.Size = new Size(130, 20);//设置大小
            VehicleLaneTX.Location = new System.Drawing.Point(30, 205);
            VehicleParametersGroup.Controls.Add(VehicleLaneTX);

            VehicleIntersectionTX = new TextBox();
            VehicleIntersectionTX.Enabled = false;
            VehicleIntersectionTX.Text = "";
            VehicleIntersectionTX.Size = new Size(130, 20);//设置大小
            VehicleIntersectionTX.Location = new System.Drawing.Point(180, 205);
            VehicleParametersGroup.Controls.Add(VehicleIntersectionTX);

            VehicleFrontCar = new Label();
            VehicleFrontCar.Text = "FrontCar";
            VehicleFrontCar.Size = new Size(130, 20);//设置大小
            VehicleFrontCar.Location = new System.Drawing.Point(30, 255);
            VehicleParametersGroup.Controls.Add(VehicleFrontCar);

            VehicleAccSpeed = new Label();
            VehicleAccSpeed.Text = "AccSpeed";
            VehicleAccSpeed.Size = new Size(130, 20);//设置大小
            VehicleAccSpeed.Location = new System.Drawing.Point(180, 255);
            VehicleParametersGroup.Controls.Add(VehicleAccSpeed);

            VehicleFrontCarTX = new TextBox();
            VehicleFrontCarTX.Enabled = false;
            VehicleFrontCarTX.Text = "";
            VehicleFrontCarTX.Size = new Size(130, 20);//设置大小
            VehicleFrontCarTX.Location = new System.Drawing.Point(30, 280);
            VehicleParametersGroup.Controls.Add(VehicleFrontCarTX);

            VehicleAccSpeedTX = new TextBox();
            VehicleAccSpeedTX.Enabled = false;
            VehicleAccSpeedTX.Text = "";
            VehicleAccSpeedTX.Size = new Size(130, 20);//设置大小
            VehicleAccSpeedTX.Location = new System.Drawing.Point(180, 280);
            VehicleParametersGroup.Controls.Add(VehicleAccSpeedTX);
        }
        

        //配置路口策略
        private void ConfigAgentGroup()
        {
            //FAFPSV = new CheckBox();
            //FAFPSV.Text = "FAFPSV";
            //FAFPSV.Size = new Size(130, 20);//设置大小
            //FAFPSV.Location = new System.Drawing.Point(30, 30);
            //AgentSchedualGroup.Controls.Add(FAFPSV);
            

            //FAFPSQ = new CheckBox();
            //FAFPSQ.Text = "FAFPSQ";
            //FAFPSQ.Size = new Size(130, 20);//设置大小
            //FAFPSQ.Location = new System.Drawing.Point(180, 30);
            //AgentSchedualGroup.Controls.Add(FAFPSQ);


            //FAFPSQSV = new CheckBox();
            //FAFPSQSV.Text = "FAFPSQSV";
            //FAFPSQSV.Size = new Size(130, 20);//设置大小
            //FAFPSQSV.Location = new System.Drawing.Point(30, 70);
            //AgentSchedualGroup.Controls.Add(FAFPSQSV);


            //FAFPMQ = new CheckBox();
            //FAFPMQ.Text = "FAFPMQ";
            //FAFPMQ.Size = new Size(130, 20);//设置大小
            //FAFPMQ.Location = new System.Drawing.Point(180, 70);
            //AgentSchedualGroup.Controls.Add(FAFPMQ);

            //HQEPSV = new CheckBox();
            //HQEPSV.Text = "HQEPSV";
            //HQEPSV.Size = new Size(130, 20);//设置大小
            //HQEPSV.Location = new System.Drawing.Point(30, 110);
            //AgentSchedualGroup.Controls.Add(HQEPSV);

            
            //HWFPMQ = new CheckBox();
            //HWFPMQ.Text = "HWFPMQ";
            //HWFPMQ.Size = new Size(130, 20);//设置大小
            //HWFPMQ.Location = new System.Drawing.Point(180, 110);
            //AgentSchedualGroup.Controls.Add(HWFPMQ);

            //HWFPSQSV = new CheckBox();
            //HWFPSQSV.Text = "HWFPSQSV";
            //HWFPSQSV.Size = new Size(130, 20);//设置大小
            //HWFPSQSV.Location = new System.Drawing.Point(30, 150);
            //AgentSchedualGroup.Controls.Add(HWFPSQSV);

            //HWFPSQ= new CheckBox();
            //HWFPSQ.Text = "HWFPSQ";
            //HWFPSQ.Size = new Size(130, 20);//设置大小
            //HWFPSQ.Location = new System.Drawing.Point(180, 150);
            //AgentSchedualGroup.Controls.Add(HWFPSQ);

            //路口序号
            IntersectionSerialNumberTxt = new Label();
            IntersectionSerialNumberTxt.Text = "InterNO.";
            IntersectionSerialNumberTxt.Size = new Size(100, 20);//设置大小
            IntersectionSerialNumberTxt.Location = new System.Drawing.Point(30, 35);
            AgentSchedualGroup.Controls.Add(IntersectionSerialNumberTxt);

            IntersectionSerialNumber = new ComboBox();
            IntersectionSerialNumber.Size = new Size(60, 18);//设置大小
            IntersectionSerialNumber.Location = new System.Drawing.Point(150, 30);
            string[] SerialNum = { "1", "2", "3", "4", "5", "6", "All" };
            IntersectionSerialNumber.Items.AddRange(SerialNum);
            IntersectionSerialNumber.SelectedIndex = 6;
            AgentSchedualGroup.Controls.Add(IntersectionSerialNumber);

            //路口策略
            IntersectionPolicyTxt = new Label();
            IntersectionPolicyTxt.Text = "Policy";
            IntersectionPolicyTxt.Size = new Size(100, 20);//设置大小
            IntersectionPolicyTxt.Location = new System.Drawing.Point(30, 75);
            AgentSchedualGroup.Controls.Add(IntersectionPolicyTxt);

            IntersectionPolicy = new ComboBox();
            IntersectionPolicy.Size = new Size(140, 18);//设置大小
            IntersectionPolicy.Location = new System.Drawing.Point(150, 70);
            string[] Policy = { "FAFP-SV", "FAFP-SQ", "FAFP-MQ","HQEP-SV",  "HWFP-SQ-SV" };
            IntersectionPolicy.Items.AddRange(Policy);
            IntersectionPolicy.SelectedIndex = 1;
            IntersectionPolicy.SelectedIndexChanged += new System.EventHandler(this.PolicySelectedIndexChanged);
            AgentSchedualGroup.Controls.Add(IntersectionPolicy);

            //路口授权数量
            VehicleNumTxt = new Label();
            VehicleNumTxt.Text = "VNums";
            VehicleNumTxt.Size = new Size(100, 20);//设置大小
            VehicleNumTxt.Location = new System.Drawing.Point(30, 115);
            AgentSchedualGroup.Controls.Add(VehicleNumTxt);

            VehicleNums = new ComboBox();
            VehicleNums.Size = new Size(60, 18);//设置大小
            VehicleNums.Location = new System.Drawing.Point(150, 110);
            string[] Num = { "1","2","3","4","5","6","7","8"};            
            VehicleNums.Items.AddRange(Num);
            VehicleNums.SelectedIndex = 3;
            AgentSchedualGroup.Controls.Add(VehicleNums);


            ApplyButton = new Button();
            ApplyButton.Text = "Apply";
            ApplyButton.Width = 100;
            ApplyButton.Height = 30;
            ApplyButton.Location = new System.Drawing.Point(30, 155);
            ApplyButton.Click += new System.EventHandler(this.ApplyButtonClick);
            AgentSchedualGroup.Controls.Add(ApplyButton);


            ResetButton = new Button();
            ResetButton.Text = "Reset";
            ResetButton.Width = 100;
            ResetButton.Height = 30;
            ResetButton.Location = new System.Drawing.Point(180, 155);
            ResetButton.Click += new System.EventHandler(this.ResetButtonClick);
            AgentSchedualGroup.Controls.Add(ResetButton);

            //SelectAll = new CheckBox();
            //SelectAll.Text = "SeleAll";
            //SelectAll.Size = new Size(125, 20);//设置大小
            //SelectAll.Location = new System.Drawing.Point(180, 190);
            //AgentSchedualGroup.Controls.Add(SelectAll);

        }

        //配置全局策略
        private void ConfigGlobalGroup() 
        {
            DijsktraS = new CheckBox();
            DijsktraS.Text = "DijkstraS";
            DijsktraS.Size = new Size(135, 30);//设置大小
            DijsktraS.Location = new System.Drawing.Point(30, 33);
            GlobalSchedualGroup.Controls.Add(DijsktraS);


            DijsktraD = new CheckBox();
            DijsktraD.Text = "DijkstraD";
            DijsktraD.Size = new Size(135, 30);//设置大小
            DijsktraD.Location = new System.Drawing.Point(180, 33);
            GlobalSchedualGroup.Controls.Add(DijsktraD);



        }

        //配置VI/II消息显示控制
        private void ConfigInformationGroup()
        {
            //显示车辆需要申请临界区的信息
            ShowVI = new CheckBox();
            ShowVI.Text = "ShowVI";
            ShowVI.Size = new Size(135, 30);//设置大小
            ShowVI.Location = new System.Drawing.Point(30, 33);
            ShowVI.Checked = true;
            InformationDisplayGroup.Controls.Add(ShowVI);
            ShowVI.CheckedChanged += new System.EventHandler(this.ShowVICheckedChanged);

            //显示路口授权信息
            ShowII = new CheckBox();
            ShowII.Text = "ShowII";
            ShowII.Size = new Size(135, 30);//设置大小
            ShowII.Location = new System.Drawing.Point(180, 33);
            ShowII.Checked = true;
            InformationDisplayGroup.Controls.Add(ShowII);
            ShowII.CheckedChanged += new System.EventHandler(this.ShowIICheckedChanged);

        }

        //设置按钮Button
        private void ConfigButtonGroup() 
        {
            //控件Panel上放置按钮StartButton
            StartButton = new Button();
            StartButton.Text = "Start";
            StartButton.Width = 130;
            StartButton.Height = 30;
            StartButton.Location = new System.Drawing.Point(30, 50);
            StartButton.Click += new System.EventHandler(this.StartButtonClick);
            FunctionButtonGroup.Controls.Add(StartButton);

            //控件Panel上放置按钮SuspendButton
            SuspendButton = new Button();
            SuspendButton.Text = "Suspend";
            SuspendButton.Width = 130;
            SuspendButton.Height = 30;
            SuspendButton.Location = new System.Drawing.Point(180, 50);
            SuspendButton.Click += new System.EventHandler(this.SuspendButtonClick);
            FunctionButtonGroup.Controls.Add(SuspendButton);

            ExportButton = new Button();
            ExportButton.Text = "Export";
            ExportButton.Width = 130;
            ExportButton.Height = 30;
            ExportButton.Location = new System.Drawing.Point(30, 105);
            FunctionButtonGroup.Controls.Add(ExportButton);

            ImportButton = new Button();
            ImportButton.Text = "Import";
            ImportButton.Width = 130;
            ImportButton.Height = 30;
            ImportButton.Location = new System.Drawing.Point(180, 105);
            FunctionButtonGroup.Controls.Add(ImportButton);


            RecordDataButton = new Button();
            RecordDataButton.Text = "RecordData";
            RecordDataButton.Width = 130;
            RecordDataButton.Height = 30;
            RecordDataButton.Location = new System.Drawing.Point(30, 160);
            FunctionButtonGroup.Controls.Add(RecordDataButton);

            PlaybackButton = new Button();
            PlaybackButton.Text = "Playback";
            PlaybackButton.Width = 130;
            PlaybackButton.Height = 30;
            PlaybackButton.Location = new System.Drawing.Point(180, 160);
            FunctionButtonGroup.Controls.Add(PlaybackButton);


        }

        //绘制Diagram界面
        private void ConfigDiagramGroup() 
        {
            //速度折线图
            SpeedChart = new Chart();
            this.SpeedChart.Size = new System.Drawing.Size(320, 180);
            this.SpeedChart.Location = new System.Drawing.Point(5, 30);
            this.SpeedChart.BackColor = System.Drawing.SystemColors.Control;
            chartArea2.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
            chartArea2.AxisX.MajorGrid.LineColor = System.Drawing.Color.White;
            chartArea2.AxisY.MajorGrid.LineColor = System.Drawing.Color.White;
            chartArea2.BackColor = System.Drawing.SystemColors.Control;
            chartArea2.Name = "ChartArea1";
            chartArea2.Position.Auto = false;
            chartArea2.Position.Height = 94F;
            chartArea2.Position.Width = 80F;
            chartArea2.Position.X = 3F;
            chartArea2.Position.Y = 3F;
            this.SpeedChart.ChartAreas.Add(chartArea2);
            legend2.BackColor = System.Drawing.SystemColors.Control;
            legend2.Name = "Legend1";
            this.SpeedChart.Legends.Add(legend2);
            this.SpeedChart.Name = "SpeedChart";
            series2.ChartArea = "ChartArea1";
            series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series2.LabelBackColor = System.Drawing.SystemColors.Control;
            series2.LabelBorderColor = System.Drawing.SystemColors.Control;
            series2.Legend = "Legend1";
            series2.Name = "m/s";
            series2.YValuesPerPoint = 10;
            series2.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double;
            this.SpeedChart.Series.Add(series2);    
            this.SpeedChart.Text = "chart1";
            ChartDiagramGroup.Controls.Add(SpeedChart);



            //加速度折线图
            Accchart = new Chart();
            this.Accchart.Size = new System.Drawing.Size(320, 180);
            this.Accchart.Location = new System.Drawing.Point(5, 220);
            this.Accchart.BackColor = System.Drawing.SystemColors.Control;
            chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
            chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.White;
            chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.White;
            chartArea1.BackColor = System.Drawing.SystemColors.Control;
            chartArea1.Name = "ChartArea1";
            chartArea1.Position.Auto = false;
            chartArea1.Position.Height = 94F;
            chartArea1.Position.Width = 80F;
            chartArea1.Position.X = 3F;
            chartArea1.Position.Y = 3F;
            this.Accchart.ChartAreas.Add(chartArea1);
            legend1.BackColor = System.Drawing.SystemColors.Control;
            legend1.Name = "Legend1";
            this.Accchart.Legends.Add(legend1);            
            this.Accchart.Name = "Accchart";
            series1.ChartArea = "ChartArea1";
            series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series1.Legend = "Legend1";
            series1.Name = "m/s^2";
            series1.YValuesPerPoint = 10;
            series1.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double;
            this.Accchart.Series.Add(series1);     
            this.Accchart.Text = "chart1";
            ChartDiagramGroup.Controls.Add(Accchart);
        }

        //设置显示路口授权信息的控件
        public void ConfigAgentInformationGroup()
        {
            //显示路口CCSID
            this.AgentNumberLabel = new Label();
            this.AgentNumberLabel.Location = new System.Drawing.Point(40, 30);
            this.AgentNumberLabel.Name = "AgentNumberLabel";
            this.AgentNumberLabel.Size = new System.Drawing.Size(285, 20);
            this.AgentNumberLabel.Text = "Intersection Number";
            AgentInformationGroup.Controls.Add(AgentNumberLabel);

            //显示
            this.AuthrizeTextBox = new TextBox();
            this.AuthrizeTextBox.Location = new System.Drawing.Point(40, 70);
            this.AuthrizeTextBox.Name = "AuthrizeLabel";
            this.AuthrizeTextBox.Size = new System.Drawing.Size(280, 180);
            this.AuthrizeTextBox.Multiline = true;
            this.AuthrizeTextBox.ScrollBars = ScrollBars.Vertical;
            this.AuthrizeTextBox.Text = "  CSID----ID";
            AgentInformationGroup.Controls.Add(AuthrizeTextBox);

            //显示路口授权的车辆
            //this.AuthrizeLabel = new Label();
            //this.AuthrizeLabel.Location = new System.Drawing.Point(50, 70);
            //this.AuthrizeLabel.Name = "AuthrizeLabel";
            //this.AuthrizeLabel.Size = new System.Drawing.Size(280, 250);
            //this.AuthrizeLabel.TabIndex = 2;
            //this.AuthrizeLabel.Text = "  CSID----ID";
            //AgentInformationGroup.Controls.Add(AuthrizeLabel);
        }


        //设置显示软件版本信息
        public void ConfigSoftwareVersionGroup() 
        {
            //SoftwarePictureBox = new PictureBox();
            //SoftwarePictureBox.Size = new Size(100, 100);//设置大小
            //SoftwarePictureBox.Location = new System.Drawing.Point(100, 25);
            //string MapUrl = MainData.Map.GetMapImageURL();
            //string LogoUrl = MapUrl.Substring(0,MapUrl.Length-22);
            ////LogoUrl += "Images\\NwpuLogo.gif";
            //LogoUrl += "Images\\icon.ico";
            //SoftwarePictureBox.Image = Image.FromFile(LogoUrl);
            //SoftwarePictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            //SoftwareVersionGroup.Controls.Add(SoftwarePictureBox);

            ////设置Version
            //SoftwareVersionIDLabel = new Label();
            //SoftwareVersionIDLabel.Text = "Version：3.1.1\r\n";
            //SoftwareVersionIDLabel.Size = new Size(260, 20);//设置大小
            //SoftwareVersionIDLabel.Location = new System.Drawing.Point(20, 25);
            //SoftwareVersionGroup.Controls.Add(SoftwareVersionIDLabel);

            ////设置VersionName
            //SoftwareVersionNameLabel = new Label();
            //SoftwareVersionNameLabel.Text = "VersionName：Stark\r\n";
            //SoftwareVersionNameLabel.Size = new Size(260, 20);//设置大小
            //SoftwareVersionNameLabel.Location = new System.Drawing.Point(20, 55);
            //SoftwareVersionGroup.Controls.Add(SoftwareVersionNameLabel);

            ////设置Version版权
            //SoftwareVersionCopyrightLabel = new Label();
            //SoftwareVersionCopyrightLabel.Text = "CopyRight：©2018 503B";
            //SoftwareVersionCopyrightLabel.Size = new Size(260, 20);//设置大小
            //SoftwareVersionCopyrightLabel.Location = new System.Drawing.Point(20, 85);
            //SoftwareVersionGroup.Controls.Add(SoftwareVersionCopyrightLabel);
        }

        //显示车道Lane速度
        public void ConfigLaneSpeed() 
        {
            //L1--------------
            SpeedPictureBox1 = new PictureBox();
            SpeedPictureBox1.Size = new Size(59, 132);//设置大小
            SpeedPictureBox1.Location = new System.Drawing.Point(380, 150);
            string MapUrl = MainData.Map.GetMapImageURL();
            string LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox1.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox1);

            LimitSpeedLabel1 = new Label();
            LimitSpeedLabel1.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel1.Size = new Size(40, 40);
            LimitSpeedLabel1.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel1.BackColor = Color.Transparent;
            LimitSpeedLabel1.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox1.Controls.Add(LimitSpeedLabel1);

            CurrentSpeedLabel1 = new Label();
            CurrentSpeedLabel1.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel1.Size = new Size(59, 40);
            CurrentSpeedLabel1.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel1.BackColor = Color.Transparent;
            CurrentSpeedLabel1.Text = "12.000";
            SpeedPictureBox1.Controls.Add(CurrentSpeedLabel1);


            //L2
            SpeedPictureBox2 = new PictureBox();
            SpeedPictureBox2.Size = new Size(59, 132);//设置大小
            SpeedPictureBox2.Location = new System.Drawing.Point(497, 150);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox2.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox2);

            LimitSpeedLabel2 = new Label();
            LimitSpeedLabel2.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel2.Size = new Size(40, 40);
            LimitSpeedLabel2.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel2.BackColor = Color.Transparent;
            LimitSpeedLabel2.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox2.Controls.Add(LimitSpeedLabel2);

            CurrentSpeedLabel2 = new Label();
            CurrentSpeedLabel2.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel2.Size = new Size(59, 40);
            CurrentSpeedLabel2.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel2.BackColor = Color.Transparent;
            CurrentSpeedLabel2.Text = "12.000";
            SpeedPictureBox2.Controls.Add(CurrentSpeedLabel2);

            //L3
            SpeedPictureBox3 = new PictureBox();
            SpeedPictureBox3.Size = new Size(59, 132);//设置大小
            SpeedPictureBox3.Location = new System.Drawing.Point(1315, 150);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox3.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox3.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox3);

            LimitSpeedLabel3 = new Label();
            LimitSpeedLabel3.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel3.Size = new Size(40, 40);
            LimitSpeedLabel3.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel3.BackColor = Color.Transparent;
            LimitSpeedLabel3.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox3.Controls.Add(LimitSpeedLabel3);

            CurrentSpeedLabel3 = new Label();
            CurrentSpeedLabel3.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel3.Size = new Size(59, 40);
            CurrentSpeedLabel3.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel3.BackColor = Color.Transparent;
            CurrentSpeedLabel3.Text = "12.000";
            SpeedPictureBox3.Controls.Add(CurrentSpeedLabel3);

            //L4
            SpeedPictureBox4 = new PictureBox();
            SpeedPictureBox4.Size = new Size(59, 132);//设置大小
            SpeedPictureBox4.Location = new System.Drawing.Point(1432, 150);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox4.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox4.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox4);

            LimitSpeedLabel4 = new Label();
            LimitSpeedLabel4.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel4.Size = new Size(40, 40);
            LimitSpeedLabel4.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel4.BackColor = Color.Transparent;
            LimitSpeedLabel4.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox4.Controls.Add(LimitSpeedLabel4);

            CurrentSpeedLabel4 = new Label();
            CurrentSpeedLabel4.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel4.Size = new Size(59, 40);
            CurrentSpeedLabel4.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel4.BackColor = Color.Transparent;
            CurrentSpeedLabel4.Text = "12.000";
            SpeedPictureBox4.Controls.Add(CurrentSpeedLabel4);


            //L5
            SpeedPictureBox5 = new PictureBox();
            SpeedPictureBox5.Size = new Size(59, 132);//设置大小
            SpeedPictureBox5.Location = new System.Drawing.Point(2250, 150);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox5.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox5.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox5);

            LimitSpeedLabel5 = new Label();
            LimitSpeedLabel5.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel5.Size = new Size(40, 40);
            LimitSpeedLabel5.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel5.BackColor = Color.Transparent;
            LimitSpeedLabel5.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox5.Controls.Add(LimitSpeedLabel5);

            CurrentSpeedLabel5 = new Label();
            CurrentSpeedLabel5.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel5.Size = new Size(59, 40);
            CurrentSpeedLabel5.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel5.BackColor = Color.Transparent;
            CurrentSpeedLabel5.Text = "12.000";
            SpeedPictureBox5.Controls.Add(CurrentSpeedLabel5);

            //L6
            SpeedPictureBox6 = new PictureBox();
            SpeedPictureBox6.Size = new Size(59, 132);//设置大小
            SpeedPictureBox6.Location = new System.Drawing.Point(2367, 150);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox6.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox6.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox6);

            LimitSpeedLabel6 = new Label();
            LimitSpeedLabel6.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel6.Size = new Size(40, 40);
            LimitSpeedLabel6.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel6.BackColor = Color.Transparent;
            LimitSpeedLabel6.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox6.Controls.Add(LimitSpeedLabel6);

            CurrentSpeedLabel6 = new Label();
            CurrentSpeedLabel6.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel6.Size = new Size(59, 40);
            CurrentSpeedLabel6.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel6.BackColor = Color.Transparent;
            CurrentSpeedLabel6.Text = "12.000";
            SpeedPictureBox6.Controls.Add(CurrentSpeedLabel6);


            //L7----------------
            SpeedPictureBox7 = new PictureBox();
            SpeedPictureBox7.Size = new Size(132, 49);//设置大小
            SpeedPictureBox7.Location = new System.Drawing.Point(150, 390);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0,MapUrl.Length-22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox7.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox7.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox7);

            LimitSpeedLabel7 = new Label();
            LimitSpeedLabel7.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel7.Size = new Size(40, 40);
            LimitSpeedLabel7.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel7.BackColor = Color.Transparent;
            LimitSpeedLabel7.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox7.Controls.Add(LimitSpeedLabel7);

            CurrentSpeedLabel7 = new Label();
            CurrentSpeedLabel7.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel7.Size = new Size(80, 40);
            CurrentSpeedLabel7.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel7.BackColor = Color.Transparent;
            CurrentSpeedLabel7.Text = "12.000";
            SpeedPictureBox7.Controls.Add(CurrentSpeedLabel7);


            //L8
            SpeedPictureBox8 = new PictureBox();
            SpeedPictureBox8.Size = new Size(132, 49);//设置大小
            SpeedPictureBox8.Location = new System.Drawing.Point(150, 497);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox8.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox8.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox8);

            LimitSpeedLabel8 = new Label();
            LimitSpeedLabel8.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel8.Size = new Size(40, 40);
            LimitSpeedLabel8.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel8.BackColor = Color.Transparent;
            LimitSpeedLabel8.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox8.Controls.Add(LimitSpeedLabel8);

            CurrentSpeedLabel8 = new Label();
            CurrentSpeedLabel8.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel8.Size = new Size(80, 40);
            CurrentSpeedLabel8.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel8.BackColor = Color.Transparent;
            CurrentSpeedLabel8.Text = "12.000";
            SpeedPictureBox8.Controls.Add(CurrentSpeedLabel8);


            //L9
            SpeedPictureBox9 = new PictureBox();
            SpeedPictureBox9.Size = new Size(132, 49);//设置大小
            SpeedPictureBox9.Location = new System.Drawing.Point(869, 390);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox9.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox9.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox9);

            LimitSpeedLabel9 = new Label();
            LimitSpeedLabel9.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel9.Size = new Size(40, 40);
            LimitSpeedLabel9.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel9.BackColor = Color.Transparent;
            LimitSpeedLabel9.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox9.Controls.Add(LimitSpeedLabel9);

            CurrentSpeedLabel9 = new Label();
            CurrentSpeedLabel9.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel9.Size = new Size(80, 40);
            CurrentSpeedLabel9.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel9.BackColor = Color.Transparent;
            CurrentSpeedLabel9.Text = "12.000";
            SpeedPictureBox9.Controls.Add(CurrentSpeedLabel9);

            //L10
            SpeedPictureBox10 = new PictureBox();
            SpeedPictureBox10.Size = new Size(132, 49);//设置大小
            SpeedPictureBox10.Location = new System.Drawing.Point(869, 497);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox10.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox10.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox10);

            LimitSpeedLabel10 = new Label();
            LimitSpeedLabel10.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel10.Size = new Size(40, 40);
            LimitSpeedLabel10.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel10.BackColor = Color.Transparent;
            LimitSpeedLabel10.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox10.Controls.Add(LimitSpeedLabel10);

            CurrentSpeedLabel10 = new Label();
            CurrentSpeedLabel10.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel10.Size = new Size(80, 40);
            CurrentSpeedLabel10.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel10.BackColor = Color.Transparent;
            CurrentSpeedLabel10.Text = "12.000";
            SpeedPictureBox10.Controls.Add(CurrentSpeedLabel10);

            //L11
            SpeedPictureBox11 = new PictureBox();
            SpeedPictureBox11.Size = new Size(132, 49);//设置大小
            SpeedPictureBox11.Location = new System.Drawing.Point(1805, 390);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox11.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox11.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox11);

            LimitSpeedLabel11 = new Label();
            LimitSpeedLabel11.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel11.Size = new Size(40, 40);
            LimitSpeedLabel11.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel11.BackColor = Color.Transparent;
            LimitSpeedLabel11.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox11.Controls.Add(LimitSpeedLabel11);

            CurrentSpeedLabel11 = new Label();
            CurrentSpeedLabel11.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel11.Size = new Size(80, 40);
            CurrentSpeedLabel11.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel11.BackColor = Color.Transparent;
            CurrentSpeedLabel11.Text = "12.000";
            SpeedPictureBox11.Controls.Add(CurrentSpeedLabel11);

            //L12
            SpeedPictureBox12 = new PictureBox();
            SpeedPictureBox12.Size = new Size(132, 49);//设置大小
            SpeedPictureBox12.Location = new System.Drawing.Point(1805, 497);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox12.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox12.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox12);

            LimitSpeedLabel12 = new Label();
            LimitSpeedLabel12.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel12.Size = new Size(40, 40);
            LimitSpeedLabel12.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel12.BackColor = Color.Transparent;
            LimitSpeedLabel12.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox12.Controls.Add(LimitSpeedLabel12);

            CurrentSpeedLabel12 = new Label();
            CurrentSpeedLabel12.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel12.Size = new Size(80, 40);
            CurrentSpeedLabel12.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel12.BackColor = Color.Transparent;
            CurrentSpeedLabel12.Text = "12.000";
            SpeedPictureBox12.Controls.Add(CurrentSpeedLabel12);

            //L13
            SpeedPictureBox13 = new PictureBox();
            SpeedPictureBox13.Size = new Size(132, 49);//设置大小
            SpeedPictureBox13.Location = new System.Drawing.Point(2610, 390);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox13.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox13.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox13);

            LimitSpeedLabel13 = new Label();
            LimitSpeedLabel13.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel13.Size = new Size(40, 40);
            LimitSpeedLabel13.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel13.BackColor = Color.Transparent;
            LimitSpeedLabel13.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox13.Controls.Add(LimitSpeedLabel13);

            CurrentSpeedLabel13 = new Label();
            CurrentSpeedLabel13.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel13.Size = new Size(80, 40);
            CurrentSpeedLabel13.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel13.BackColor = Color.Transparent;
            CurrentSpeedLabel13.Text = "12.000";
            SpeedPictureBox13.Controls.Add(CurrentSpeedLabel13);


            //L14
            SpeedPictureBox14 = new PictureBox();
            SpeedPictureBox14.Size = new Size(132, 49);//设置大小
            SpeedPictureBox14.Location = new System.Drawing.Point(2610, 497);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox14.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox14.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox14);

            LimitSpeedLabel14 = new Label();
            LimitSpeedLabel14.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel14.Size = new Size(40, 40);
            LimitSpeedLabel14.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel14.BackColor = Color.Transparent;
            LimitSpeedLabel14.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox14.Controls.Add(LimitSpeedLabel14);

            CurrentSpeedLabel14 = new Label();
            CurrentSpeedLabel14.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel14.Size = new Size(80, 40);
            CurrentSpeedLabel14.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel14.BackColor = Color.Transparent;
            CurrentSpeedLabel14.Text = "12.000";
            SpeedPictureBox14.Controls.Add(CurrentSpeedLabel14);


            //L15----------------------------
            SpeedPictureBox15 = new PictureBox();
            SpeedPictureBox15.Size = new Size(59, 132);//设置大小
            SpeedPictureBox15.Location = new System.Drawing.Point(380, 869);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox15.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox15.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox15);

            LimitSpeedLabel15 = new Label();
            LimitSpeedLabel15.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel15.Size = new Size(40, 40);
            LimitSpeedLabel15.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel15.BackColor = Color.Transparent;
            LimitSpeedLabel15.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox15.Controls.Add(LimitSpeedLabel15);

            CurrentSpeedLabel15 = new Label();
            CurrentSpeedLabel15.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel15.Size = new Size(59, 40);
            CurrentSpeedLabel15.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel15.BackColor = Color.Transparent;
            CurrentSpeedLabel15.Text = "12.000";
            SpeedPictureBox15.Controls.Add(CurrentSpeedLabel15);


            //L16
            SpeedPictureBox16 = new PictureBox();
            SpeedPictureBox16.Size = new Size(59, 132);//设置大小
            SpeedPictureBox16.Location = new System.Drawing.Point(497, 869);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox16.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox16.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox16);

            LimitSpeedLabel16 = new Label();
            LimitSpeedLabel16.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel16.Size = new Size(40, 40);
            LimitSpeedLabel16.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel16.BackColor = Color.Transparent;
            LimitSpeedLabel16.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox16.Controls.Add(LimitSpeedLabel16);

            CurrentSpeedLabel16 = new Label();
            CurrentSpeedLabel16.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel16.Size = new Size(59, 40);
            CurrentSpeedLabel16.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel16.BackColor = Color.Transparent;
            CurrentSpeedLabel16.Text = "12.000";
            SpeedPictureBox16.Controls.Add(CurrentSpeedLabel16);

            //L17
            SpeedPictureBox17 = new PictureBox();
            SpeedPictureBox17.Size = new Size(59, 132);//设置大小
            SpeedPictureBox17.Location = new System.Drawing.Point(1315, 869);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox17.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox17.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox17);

            LimitSpeedLabel17 = new Label();
            LimitSpeedLabel17.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel17.Size = new Size(40, 40);
            LimitSpeedLabel17.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel17.BackColor = Color.Transparent;
            LimitSpeedLabel17.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox17.Controls.Add(LimitSpeedLabel17);

            CurrentSpeedLabel17 = new Label();
            CurrentSpeedLabel17.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel17.Size = new Size(59, 40);
            CurrentSpeedLabel17.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel17.BackColor = Color.Transparent;
            CurrentSpeedLabel17.Text = "12.000";
            SpeedPictureBox17.Controls.Add(CurrentSpeedLabel17);


            //L18
            SpeedPictureBox18 = new PictureBox();
            SpeedPictureBox18.Size = new Size(59, 132);//设置大小
            SpeedPictureBox18.Location = new System.Drawing.Point(1432, 869);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox18.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox18.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox18);

            LimitSpeedLabel18 = new Label();
            LimitSpeedLabel18.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel18.Size = new Size(40, 40);
            LimitSpeedLabel18.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel18.BackColor = Color.Transparent;
            LimitSpeedLabel18.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox18.Controls.Add(LimitSpeedLabel18);

            CurrentSpeedLabel18 = new Label();
            CurrentSpeedLabel18.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel18.Size = new Size(59, 40);
            CurrentSpeedLabel18.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel18.BackColor = Color.Transparent;
            CurrentSpeedLabel18.Text = "12.000";
            SpeedPictureBox18.Controls.Add(CurrentSpeedLabel18);


            //L19
            SpeedPictureBox19 = new PictureBox();
            SpeedPictureBox19.Size = new Size(59, 132);//设置大小
            SpeedPictureBox19.Location = new System.Drawing.Point(2250, 869);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox19.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox19.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox19);

            LimitSpeedLabel19 = new Label();
            LimitSpeedLabel19.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel19.Size = new Size(40, 40);
            LimitSpeedLabel19.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel19.BackColor = Color.Transparent;
            LimitSpeedLabel19.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox19.Controls.Add(LimitSpeedLabel19);

            CurrentSpeedLabel19 = new Label();
            CurrentSpeedLabel19.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel19.Size = new Size(59, 40);
            CurrentSpeedLabel19.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel19.BackColor = Color.Transparent;
            CurrentSpeedLabel19.Text = "12.000";
            SpeedPictureBox19.Controls.Add(CurrentSpeedLabel19);

            //L20
            SpeedPictureBox20 = new PictureBox();
            SpeedPictureBox20.Size = new Size(59, 132);//设置大小
            SpeedPictureBox20.Location = new System.Drawing.Point(2367, 869);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox20.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox20.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox20);

            LimitSpeedLabel20 = new Label();
            LimitSpeedLabel20.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel20.Size = new Size(40, 40);
            LimitSpeedLabel20.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel20.BackColor = Color.Transparent;
            LimitSpeedLabel20.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox20.Controls.Add(LimitSpeedLabel20);

            CurrentSpeedLabel20 = new Label();
            CurrentSpeedLabel20.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel20.Size = new Size(59, 40);
            CurrentSpeedLabel20.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel20.BackColor = Color.Transparent;
            CurrentSpeedLabel20.Text = "12.000";
            SpeedPictureBox20.Controls.Add(CurrentSpeedLabel20);


            //L21-----------------------------
            SpeedPictureBox21 = new PictureBox();
            SpeedPictureBox21.Size = new Size(132, 49);//设置大小
            SpeedPictureBox21.Location = new System.Drawing.Point(150, 1325);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox21.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox21.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox21);

            LimitSpeedLabel21 = new Label();
            LimitSpeedLabel21.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel21.Size = new Size(40, 40);
            LimitSpeedLabel21.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel21.BackColor = Color.Transparent;
            LimitSpeedLabel21.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox21.Controls.Add(LimitSpeedLabel21);

            CurrentSpeedLabel21 = new Label();
            CurrentSpeedLabel21.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel21.Size = new Size(80, 40);
            CurrentSpeedLabel21.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel21.BackColor = Color.Transparent;
            CurrentSpeedLabel21.Text = "12.000";
            SpeedPictureBox21.Controls.Add(CurrentSpeedLabel21);


            //L22
            SpeedPictureBox22 = new PictureBox();
            SpeedPictureBox22.Size = new Size(132, 49);//设置大小
            SpeedPictureBox22.Location = new System.Drawing.Point(150, 1432);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox22.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox22.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox22);

            LimitSpeedLabel22 = new Label();
            LimitSpeedLabel22.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel22.Size = new Size(40, 40);
            LimitSpeedLabel22.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel22.BackColor = Color.Transparent;
            LimitSpeedLabel22.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox22.Controls.Add(LimitSpeedLabel22);

            CurrentSpeedLabel22 = new Label();
            CurrentSpeedLabel22.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel22.Size = new Size(80, 40);
            CurrentSpeedLabel22.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel22.BackColor = Color.Transparent;
            CurrentSpeedLabel22.Text = "12.000";
            SpeedPictureBox22.Controls.Add(CurrentSpeedLabel22);


            //L23
            SpeedPictureBox23 = new PictureBox();
            SpeedPictureBox23.Size = new Size(132, 49);//设置大小
            SpeedPictureBox23.Location = new System.Drawing.Point(869, 1325);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox23.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox23.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox23);

            LimitSpeedLabel23 = new Label();
            LimitSpeedLabel23.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel23.Size = new Size(40, 40);
            LimitSpeedLabel23.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel23.BackColor = Color.Transparent;
            LimitSpeedLabel23.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox23.Controls.Add(LimitSpeedLabel23);

            CurrentSpeedLabel23 = new Label();
            CurrentSpeedLabel23.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel23.Size = new Size(80, 40);
            CurrentSpeedLabel23.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel23.BackColor = Color.Transparent;
            CurrentSpeedLabel23.Text = "12.000";
            SpeedPictureBox23.Controls.Add(CurrentSpeedLabel23);

            //L24
            SpeedPictureBox24 = new PictureBox();
            SpeedPictureBox24.Size = new Size(132, 49);//设置大小
            SpeedPictureBox24.Location = new System.Drawing.Point(869, 1432);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox24.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox24.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox24);

            LimitSpeedLabel24 = new Label();
            LimitSpeedLabel24.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel24.Size = new Size(40, 40);
            LimitSpeedLabel24.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel24.BackColor = Color.Transparent;
            LimitSpeedLabel24.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox24.Controls.Add(LimitSpeedLabel24);

            CurrentSpeedLabel24 = new Label();
            CurrentSpeedLabel24.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel24.Size = new Size(80, 40);
            CurrentSpeedLabel24.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel24.BackColor = Color.Transparent;
            CurrentSpeedLabel24.Text = "12.000";
            SpeedPictureBox24.Controls.Add(CurrentSpeedLabel24);


            //L25
            SpeedPictureBox25 = new PictureBox();
            SpeedPictureBox25.Size = new Size(132, 49);//设置大小
            SpeedPictureBox25.Location = new System.Drawing.Point(1805, 1325);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox25.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox25.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox25);

            LimitSpeedLabel25 = new Label();
            LimitSpeedLabel25.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel25.Size = new Size(40, 40);
            LimitSpeedLabel25.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel25.BackColor = Color.Transparent;
            LimitSpeedLabel25.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox25.Controls.Add(LimitSpeedLabel25);

            CurrentSpeedLabel25 = new Label();
            CurrentSpeedLabel25.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel25.Size = new Size(80, 40);
            CurrentSpeedLabel25.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel25.BackColor = Color.Transparent;
            CurrentSpeedLabel25.Text = "12.000";
            SpeedPictureBox25.Controls.Add(CurrentSpeedLabel25);



            //L26
            SpeedPictureBox26 = new PictureBox();
            SpeedPictureBox26.Size = new Size(132, 49);//设置大小
            SpeedPictureBox26.Location = new System.Drawing.Point(1805, 1432);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox26.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox26.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox26);

            LimitSpeedLabel26 = new Label();
            LimitSpeedLabel26.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel26.Size = new Size(40, 40);
            LimitSpeedLabel26.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel26.BackColor = Color.Transparent;
            LimitSpeedLabel26.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox26.Controls.Add(LimitSpeedLabel26);

            CurrentSpeedLabel26 = new Label();
            CurrentSpeedLabel26.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel26.Size = new Size(80, 40);
            CurrentSpeedLabel26.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel26.BackColor = Color.Transparent;
            CurrentSpeedLabel26.Text = "12.000";
            SpeedPictureBox26.Controls.Add(CurrentSpeedLabel26);
         

            //L27
            SpeedPictureBox27 = new PictureBox();
            SpeedPictureBox27.Size = new Size(132, 49);//设置大小
            SpeedPictureBox27.Location = new System.Drawing.Point(2610, 1325);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox27.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox27.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox27);

            LimitSpeedLabel27 = new Label();
            LimitSpeedLabel27.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel27.Size = new Size(40, 40);
            LimitSpeedLabel27.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel27.BackColor = Color.Transparent;
            LimitSpeedLabel27.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox27.Controls.Add(LimitSpeedLabel27);

            CurrentSpeedLabel27 = new Label();
            CurrentSpeedLabel27.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel27.Size = new Size(80, 40);
            CurrentSpeedLabel27.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel27.BackColor = Color.Transparent;
            CurrentSpeedLabel27.Text = "12.000";
            SpeedPictureBox27.Controls.Add(CurrentSpeedLabel27);


            //L28
            SpeedPictureBox28 = new PictureBox();
            SpeedPictureBox28.Size = new Size(132, 49);//设置大小
            SpeedPictureBox28.Location = new System.Drawing.Point(2610, 1432);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed1.bmp";
            SpeedPictureBox28.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox28.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox28);

            LimitSpeedLabel28 = new Label();
            LimitSpeedLabel28.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel28.Size = new Size(40, 40);
            LimitSpeedLabel28.Location = new System.Drawing.Point(12, 15);
            LimitSpeedLabel28.BackColor = Color.Transparent;
            LimitSpeedLabel28.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox28.Controls.Add(LimitSpeedLabel28);

            CurrentSpeedLabel28 = new Label();
            CurrentSpeedLabel28.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel28.Size = new Size(80, 40);
            CurrentSpeedLabel28.Location = new System.Drawing.Point(60, 23);
            CurrentSpeedLabel28.BackColor = Color.Transparent;
            CurrentSpeedLabel28.Text = "12.000";
            SpeedPictureBox28.Controls.Add(CurrentSpeedLabel28);




            //L29----------------------------
            SpeedPictureBox29 = new PictureBox();
            SpeedPictureBox29.Size = new Size(59, 132);//设置大小
            SpeedPictureBox29.Location = new System.Drawing.Point(380, 1580);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox29.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox29.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox29);

            LimitSpeedLabel29 = new Label();
            LimitSpeedLabel29.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel29.Size = new Size(40, 40);
            LimitSpeedLabel29.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel29.BackColor = Color.Transparent;
            LimitSpeedLabel29.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox29.Controls.Add(LimitSpeedLabel29);

            CurrentSpeedLabel29 = new Label();
            CurrentSpeedLabel29.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel29.Size = new Size(59, 40);
            CurrentSpeedLabel29.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel29.BackColor = Color.Transparent;
            CurrentSpeedLabel29.Text = "12.000";
            SpeedPictureBox29.Controls.Add(CurrentSpeedLabel29);


            //L30
            SpeedPictureBox30 = new PictureBox();
            SpeedPictureBox30.Size = new Size(59, 132);//设置大小
            SpeedPictureBox30.Location = new System.Drawing.Point(497, 1580);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox30.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox30.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox30);

            LimitSpeedLabel30 = new Label();
            LimitSpeedLabel30.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel30.Size = new Size(40, 40);
            LimitSpeedLabel30.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel30.BackColor = Color.Transparent;
            LimitSpeedLabel30.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox30.Controls.Add(LimitSpeedLabel30);

            CurrentSpeedLabel30 = new Label();
            CurrentSpeedLabel30.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel30.Size = new Size(59, 40);
            CurrentSpeedLabel30.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel30.BackColor = Color.Transparent;
            CurrentSpeedLabel30.Text = "12.000";
            SpeedPictureBox30.Controls.Add(CurrentSpeedLabel30);


            //L31
            SpeedPictureBox31 = new PictureBox();
            SpeedPictureBox31.Size = new Size(59, 132);//设置大小
            SpeedPictureBox31.Location = new System.Drawing.Point(1315, 1580);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox31.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox31.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox31);

            LimitSpeedLabel31 = new Label();
            LimitSpeedLabel31.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel31.Size = new Size(40, 40);
            LimitSpeedLabel31.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel31.BackColor = Color.Transparent;
            LimitSpeedLabel31.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox31.Controls.Add(LimitSpeedLabel31);

            CurrentSpeedLabel31 = new Label();
            CurrentSpeedLabel31.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel31.Size = new Size(59, 40);
            CurrentSpeedLabel31.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel31.BackColor = Color.Transparent;
            CurrentSpeedLabel31.Text = "12.000";
            SpeedPictureBox31.Controls.Add(CurrentSpeedLabel31);


            //L32
            SpeedPictureBox32 = new PictureBox();
            SpeedPictureBox32.Size = new Size(59, 132);//设置大小
            SpeedPictureBox32.Location = new System.Drawing.Point(1432, 1580);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox32.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox32.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox32);

            LimitSpeedLabel32 = new Label();
            LimitSpeedLabel32.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel32.Size = new Size(40, 40);
            LimitSpeedLabel32.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel32.BackColor = Color.Transparent;
            LimitSpeedLabel32.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox32.Controls.Add(LimitSpeedLabel32);

            CurrentSpeedLabel32 = new Label();
            CurrentSpeedLabel32.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel32.Size = new Size(59, 40);
            CurrentSpeedLabel32.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel32.BackColor = Color.Transparent;
            CurrentSpeedLabel32.Text = "12.000";
            SpeedPictureBox32.Controls.Add(CurrentSpeedLabel32);



            //L33
            SpeedPictureBox33 = new PictureBox();
            SpeedPictureBox33.Size = new Size(59, 132);//设置大小
            SpeedPictureBox33.Location = new System.Drawing.Point(2250, 1580);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox33.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox33.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox33);

            LimitSpeedLabel33 = new Label();
            LimitSpeedLabel33.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel33.Size = new Size(40, 40);
            LimitSpeedLabel33.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel33.BackColor = Color.Transparent;
            LimitSpeedLabel33.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox33.Controls.Add(LimitSpeedLabel33);

            CurrentSpeedLabel33 = new Label();
            CurrentSpeedLabel33.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel33.Size = new Size(59, 40);
            CurrentSpeedLabel33.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel33.BackColor = Color.Transparent;
            CurrentSpeedLabel33.Text = "12.000";
            SpeedPictureBox33.Controls.Add(CurrentSpeedLabel33);


            //L34
            SpeedPictureBox34 = new PictureBox();
            SpeedPictureBox34.Size = new Size(59, 132);//设置大小
            SpeedPictureBox34.Location = new System.Drawing.Point(2367, 1580);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\LimitSpeed2.bmp";
            SpeedPictureBox34.Image = Image.FromFile(LogoUrl);
            SpeedPictureBox34.SizeMode = PictureBoxSizeMode.StretchImage;
            BackgroundPanel.Controls.Add(SpeedPictureBox34);

            LimitSpeedLabel34 = new Label();
            LimitSpeedLabel34.Font = new Font("黑体", 14f, FontStyle.Bold);
            LimitSpeedLabel34.Size = new Size(40, 40);
            LimitSpeedLabel34.Location = new System.Drawing.Point(15, 28);
            LimitSpeedLabel34.BackColor = Color.Transparent;
            LimitSpeedLabel34.Text = MainData.SimulationConfig.GetTxtMaximumSpeed().ToString();
            SpeedPictureBox34.Controls.Add(LimitSpeedLabel34);

            CurrentSpeedLabel34 = new Label();
            CurrentSpeedLabel34.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            CurrentSpeedLabel34.Size = new Size(59, 40);
            CurrentSpeedLabel34.Location = new System.Drawing.Point(0, 90);
            CurrentSpeedLabel34.BackColor = Color.Transparent;
            CurrentSpeedLabel34.Text = "12.000";
            SpeedPictureBox34.Controls.Add(CurrentSpeedLabel34);

        }

        //设置车道车辆信息
        public void ConfigLaneText()
        {
            //路口一
            LaneIntersection1Label1 = new Label();
            LaneIntersection1Label1.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection1Label1.Size = new Size(230, 303);//设置大小
            LaneIntersection1Label1.BackColor = Color.Transparent;
            LaneIntersection1Label1.Location = new System.Drawing.Point(145, 65);
            //LaneIntersection1Label1.AutoScrollOffset = true;
            BackgroundPanel.Controls.Add(LaneIntersection1Label1);


            LaneIntersection1Label2 = new Label();
            LaneIntersection1Label2.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection1Label2.Size = new Size(230, 303);//设置大小
            LaneIntersection1Label2.BackColor = Color.Transparent;
            LaneIntersection1Label2.Location = new System.Drawing.Point(145, 570);
            BackgroundPanel.Controls.Add(LaneIntersection1Label2);


            LaneIntersection1Label3 = new Label();
            LaneIntersection1Label3.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection1Label3.Size = new Size(230, 303);//设置大小
            LaneIntersection1Label3.BackColor = Color.Transparent;
            LaneIntersection1Label3.Location = new System.Drawing.Point(570, 65);
            BackgroundPanel.Controls.Add(LaneIntersection1Label3);


            LaneIntersection1Label4 = new Label();
            LaneIntersection1Label4.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection1Label4.Size = new Size(230, 303);//设置大小
            LaneIntersection1Label4.BackColor = Color.Transparent;
            LaneIntersection1Label4.Location = new System.Drawing.Point(570, 570);
            BackgroundPanel.Controls.Add(LaneIntersection1Label4);





            //路口二
            LaneIntersection2Label1 = new Label();
            LaneIntersection2Label1.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection2Label1.Size = new Size(230, 303);//设置大小
            LaneIntersection2Label1.BackColor = Color.Transparent;
            LaneIntersection2Label1.Location = new System.Drawing.Point(1080, 65);
            BackgroundPanel.Controls.Add(LaneIntersection2Label1);

            LaneIntersection2Label2 = new Label();
            LaneIntersection2Label2.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection2Label2.Size = new Size(230, 303);//设置大小
            LaneIntersection2Label2.BackColor = Color.Transparent;
            LaneIntersection2Label2.Location = new System.Drawing.Point(1080, 570);
            BackgroundPanel.Controls.Add(LaneIntersection2Label2);

            LaneIntersection2Label3 = new Label();
            LaneIntersection2Label3.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection2Label3.Size = new Size(230, 303);//设置大小
            LaneIntersection2Label3.BackColor = Color.Transparent;
            LaneIntersection2Label3.Location = new System.Drawing.Point(1506, 65);
            BackgroundPanel.Controls.Add(LaneIntersection2Label3);

            LaneIntersection2Label4 = new Label();
            LaneIntersection2Label4.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection2Label4.Size = new Size(230, 303);//设置大小
            LaneIntersection2Label4.BackColor = Color.Transparent;
            LaneIntersection2Label4.Location = new System.Drawing.Point(1506, 570);
            BackgroundPanel.Controls.Add(LaneIntersection2Label4);




            //路口三
            LaneIntersection3Label1 = new Label();
            LaneIntersection3Label1.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection3Label1.Size = new Size(230, 303);//设置大小
            LaneIntersection3Label1.BackColor = Color.Transparent;
            LaneIntersection3Label1.Location = new System.Drawing.Point(2015, 65);
            BackgroundPanel.Controls.Add(LaneIntersection3Label1);

            LaneIntersection3Label2 = new Label();
            LaneIntersection3Label2.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection3Label2.Size = new Size(230, 303);//设置大小
            LaneIntersection3Label2.BackColor = Color.Transparent;
            LaneIntersection3Label2.Location = new System.Drawing.Point(2015, 570);
            BackgroundPanel.Controls.Add(LaneIntersection3Label2);

            LaneIntersection3Label3 = new Label();
            LaneIntersection3Label3.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection3Label3.Size = new Size(230, 303);//设置大小
            LaneIntersection3Label3.BackColor = Color.Transparent;
            LaneIntersection3Label3.Location = new System.Drawing.Point(2441, 65);
            BackgroundPanel.Controls.Add(LaneIntersection3Label3);

            LaneIntersection3Label4 = new Label();
            LaneIntersection3Label4.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection3Label4.Size = new Size(230, 303);//设置大小
            LaneIntersection3Label4.BackColor = Color.Transparent;
            LaneIntersection3Label4.Location = new System.Drawing.Point(2441, 570);
            BackgroundPanel.Controls.Add(LaneIntersection3Label4);




            //路口四
            LaneIntersection4Label1 = new Label();
            LaneIntersection4Label1.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection4Label1.Size = new Size(230, 303);//设置大小
            LaneIntersection4Label1.BackColor = Color.Transparent;
            LaneIntersection4Label1.Location = new System.Drawing.Point(145, 1000);
            BackgroundPanel.Controls.Add(LaneIntersection4Label1);

            LaneIntersection4Label2 = new Label();
            LaneIntersection4Label2.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection4Label2.Size = new Size(230, 303);//设置大小
            LaneIntersection4Label2.BackColor = Color.Transparent;
            LaneIntersection4Label2.Location = new System.Drawing.Point(145, 1506);
            BackgroundPanel.Controls.Add(LaneIntersection4Label2);

            LaneIntersection4Label3 = new Label();
            LaneIntersection4Label3.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection4Label3.Size = new Size(230, 303);//设置大小
            LaneIntersection4Label3.BackColor = Color.Transparent;
            LaneIntersection4Label3.Location = new System.Drawing.Point(570, 1000);
            BackgroundPanel.Controls.Add(LaneIntersection4Label3);

            LaneIntersection4Label4 = new Label();
            LaneIntersection4Label4.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection4Label4.Size = new Size(230, 303);//设置大小
            LaneIntersection4Label4.BackColor = Color.Transparent;
            LaneIntersection4Label4.Location = new System.Drawing.Point(570, 1506);
            BackgroundPanel.Controls.Add(LaneIntersection4Label4);





            //路口五
            LaneIntersection5Label1 = new Label();
            LaneIntersection5Label1.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection5Label1.Size = new Size(230, 303);//设置大小
            LaneIntersection5Label1.BackColor = Color.Transparent;
            LaneIntersection5Label1.Location = new System.Drawing.Point(1080, 1000);
            BackgroundPanel.Controls.Add(LaneIntersection5Label1);

            LaneIntersection5Label2 = new Label();
            LaneIntersection5Label2.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection5Label2.Size = new Size(230, 303);//设置大小
            LaneIntersection5Label2.BackColor = Color.Transparent;
            LaneIntersection5Label2.Location = new System.Drawing.Point(1080, 1506);
            BackgroundPanel.Controls.Add(LaneIntersection5Label2);

            LaneIntersection5Label3 = new Label();
            LaneIntersection5Label3.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection5Label3.Size = new Size(230, 303);//设置大小
            LaneIntersection5Label3.BackColor = Color.Transparent;
            LaneIntersection5Label3.Location = new System.Drawing.Point(1506, 1000);
            BackgroundPanel.Controls.Add(LaneIntersection5Label3);

            LaneIntersection5Label4 = new Label();
            LaneIntersection5Label4.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection5Label4.Size = new Size(230, 303);//设置大小
            LaneIntersection5Label4.BackColor = Color.Transparent;
            LaneIntersection5Label4.Location = new System.Drawing.Point(1506, 1506);
            BackgroundPanel.Controls.Add(LaneIntersection5Label4);





            //路口六
            LaneIntersection6Label1 = new Label();
            LaneIntersection6Label1.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection6Label1.Size = new Size(230, 303);//设置大小
            LaneIntersection6Label1.BackColor = Color.Transparent;
            LaneIntersection6Label1.Location = new System.Drawing.Point(2015, 1000);
            BackgroundPanel.Controls.Add(LaneIntersection6Label1);

            LaneIntersection6Label2 = new Label();
            LaneIntersection6Label2.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection6Label2.Size = new Size(230, 303);//设置大小
            LaneIntersection6Label2.BackColor = Color.Transparent;
            LaneIntersection6Label2.Location = new System.Drawing.Point(2015, 1506);
            BackgroundPanel.Controls.Add(LaneIntersection6Label2);

            LaneIntersection6Label3 = new Label();
            LaneIntersection6Label3.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection6Label3.Size = new Size(230, 303);//设置大小
            LaneIntersection6Label3.BackColor = Color.Transparent;
            LaneIntersection6Label3.Location = new System.Drawing.Point(2441, 1000);
            BackgroundPanel.Controls.Add(LaneIntersection6Label3);

            LaneIntersection6Label4 = new Label();
            LaneIntersection6Label4.Font = new Font("宋体", 14f, FontStyle.Bold);
            LaneIntersection6Label4.Size = new Size(230, 303);//设置大小
            LaneIntersection6Label4.BackColor = Color.Transparent;
            LaneIntersection6Label4.Location = new System.Drawing.Point(2441, 1506);
            BackgroundPanel.Controls.Add(LaneIntersection6Label4);

        }

       
        /// <summary>
        /// 不停绘制背景界面
        /// </summary>
        private void DrawBackground()
        {
            //更新图片的缓存
            if (BackgroundBitmap != null)
            {
                BackgroundBitmap.Dispose();
                BackgroundBitmap = null;
            }
            if (MapGraphics != null)
            {
                MapGraphics.Dispose();
                MapGraphics = null;
            }

            BackgroundBitmap = new Bitmap(MainData.Map.GetMapImageURL());
            MapGraphics = Graphics.FromImage(BackgroundBitmap);
            
            int[] X = new int[6];
            int[] Y = new int[6];

            //存储所有的车辆到队列中
            foreach (Vehicle vtmp in MainData.Map.GlobalVehicleList)
            {
                Coordinate.gui_coordinate c = new Coordinate.gui_coordinate();
                c.ID = vtmp.Get_ID();
                c.LaneID = vtmp.Get_LaneID();
                c.OriginalPriority = vtmp.Get_Origin_Priority();
                c.CurrentPriority = vtmp.Get_Current_Priority();
                c.Sections = vtmp.Get_SectionID();
                c.CarType = vtmp.Get_Cartype();
                c.Original_Dir = vtmp.Get_Act_Direction_Origin();
                c.Origianl_LaneID = vtmp.Get_LaneIDOrigin();
                c.IntersctionID = vtmp.GetIntersectionID();
                c.IntersectionNumber = vtmp.GetIntersectionNumber();
                c.X[Definitions.FrontMiddle] = vtmp.Get_X(Definitions.FrontMiddle);
                c.X[Definitions.FrontLeft] = vtmp.Get_X(Definitions.FrontLeft);
                c.X[Definitions.FrontRight] = vtmp.Get_X(Definitions.FrontRight);
                c.X[Definitions.BackLeft] = vtmp.Get_X(Definitions.BackLeft);
                c.X[Definitions.BackRight] = vtmp.Get_X(Definitions.BackRight);
                c.Y[Definitions.FrontMiddle] = vtmp.Get_Y(Definitions.FrontMiddle);
                c.Y[Definitions.FrontLeft] = vtmp.Get_Y(Definitions.FrontLeft);
                c.Y[Definitions.FrontRight] = vtmp.Get_Y(Definitions.FrontRight);
                c.Y[Definitions.BackLeft] = vtmp.Get_Y(Definitions.BackLeft);
                c.Y[Definitions.BackRight] = vtmp.Get_Y(Definitions.BackRight);
                //记录车辆是否被授权
                if (vtmp.Get_IsAuth() == true)
                {
                    c.IsAuthorized = true;
                }
                else
                {
                    c.IsAuthorized = false;
                }
                this.coordinates.Enqueue(c);

            }           


            //按照路口设置标志线
            Pen p = new Pen(Color.Black, 2);//定义了一个蓝色,宽度为2的画笔
            for (int i = 1; i <= MainData.Map.GetIntNum(); i++) 
            {
                int intlength_x = 0;   //计算应该平移的x位置
                int intwidth_y = 0;    //计算应该平移的y位置
                
                int wid = MainData.Map.GetLengthIntNum();
                if (i % wid == 0)
                {
                    intlength_x = (wid - 1) * 187 * 5;
                }
                else 
                {
                    intlength_x = ((i % wid) - 1) * 187*5;
                }

                if (i % wid == 0)
                {
                    if (i / wid == 1)
                    {
                        intwidth_y = 0 * 187 * 5;
                    }
                    else 
                    {
                        intwidth_y = ((i / wid) - 1) * 187 * 5;
                    }
                }
                else 
                {
                    intwidth_y = (i / wid) * 187 * 5;
                }

               
                //绘制标志线（减速线、预约线、路口刹车安全线）
                MapGraphics.DrawLine(p, 440 + intlength_x, Coordinate.EnterLine * this.Ratio + intwidth_y, 450 + intlength_x, Coordinate.EnterLine * this.Ratio + intwidth_y);
                MapGraphics.DrawLine(p, 440 + intlength_x, Coordinate.ReservationLine * this.Ratio + intwidth_y, 450 + intlength_x, Coordinate.ReservationLine * this.Ratio + intwidth_y);
                MapGraphics.DrawLine(p, 440 + intlength_x, Coordinate.IntersactionStopLine * this.Ratio + intwidth_y, 450 + intlength_x, Coordinate.IntersactionStopLine * this.Ratio + intwidth_y);

                MapGraphics.DrawLine(p, 485 + intlength_x, (187.0f - Coordinate.EnterLine) * 5 + intwidth_y, 495 + intlength_x, (187.0f - Coordinate.EnterLine) * 5 + intwidth_y);
                MapGraphics.DrawLine(p, 485 + intlength_x, (187.0f - Coordinate.ReservationLine) * 5 + intwidth_y, 495 + intlength_x, (187.0f - Coordinate.ReservationLine) * 5 + intwidth_y);
                MapGraphics.DrawLine(p, 485 + intlength_x, (187.0f - Coordinate.IntersactionStopLine) * 5 + intwidth_y, 495 + intlength_x, (187.0f - Coordinate.IntersactionStopLine) * 5 + intwidth_y);

                MapGraphics.DrawLine(p, Coordinate.EnterLine * this.Ratio + intlength_x, 485 + intwidth_y, Coordinate.EnterLine * this.Ratio + intlength_x, 495 + intwidth_y);
                MapGraphics.DrawLine(p, Coordinate.ReservationLine * this.Ratio + intlength_x, 485 + intwidth_y, Coordinate.ReservationLine * this.Ratio + intlength_x, 495 + intwidth_y);
                MapGraphics.DrawLine(p, Coordinate.IntersactionStopLine * this.Ratio + intlength_x, 485 + intwidth_y, Coordinate.IntersactionStopLine * this.Ratio + intlength_x, 495 + intwidth_y);

                MapGraphics.DrawLine(p, (187.0f - Coordinate.EnterLine) * this.Ratio + intlength_x, 440 + intwidth_y, (187.0f - Coordinate.EnterLine) * this.Ratio + intlength_x, 450 + intwidth_y);
                MapGraphics.DrawLine(p, (187.0f - Coordinate.ReservationLine) * this.Ratio + intlength_x, 440 + intwidth_y, (187.0f - Coordinate.ReservationLine) * this.Ratio + intlength_x, 450 + intwidth_y);
                MapGraphics.DrawLine(p, (187.0f - Coordinate.IntersactionStopLine) * this.Ratio + intlength_x, 440 + intwidth_y, (187.0f - Coordinate.IntersactionStopLine) * this.Ratio + intlength_x, 450 + intwidth_y);


                //选中路口1
                if (this.CurSelectedIntersection == 0)
                {
                    if (PictureCountTime == 1)
                    {
                        Pen pen = new Pen(Color.Red, 1.5f);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 452, 452, 30, 30);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 2)
                    {
                        Pen pen = new Pen(Color.Red, 2);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 437, 437, 60, 60);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 3)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 422, 422, 90, 90);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 4)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 407, 407, 120, 120);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 5)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 392, 392, 150, 150);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                }
                    //选中路口二
                else if (this.CurSelectedIntersection == 1) 
                {
                    if (PictureCountTime == 1)
                    {
                        Pen pen = new Pen(Color.Red, 1.5f);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 452+935, 452, 30, 30);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 2)
                    {
                        Pen pen = new Pen(Color.Red, 2);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 437 + 935, 437, 60, 60);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 3)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 422 + 935, 422, 90, 90);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 4)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 407 + 935, 407, 120, 120);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 5)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 392 + 935, 392, 150, 150);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                }


                  //选中路口三
                else if (this.CurSelectedIntersection == 2)
                {
                    if (PictureCountTime == 1)
                    {
                        Pen pen = new Pen(Color.Red, 1.5f);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 452 + 935+935, 452, 30, 30);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 2)
                    {
                        Pen pen = new Pen(Color.Red, 2);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 437 + 935 + 935, 437, 60, 60);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 3)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 422 + 935 + 935, 422, 90, 90);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 4)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 407 + 935 + 935, 407, 120, 120);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 5)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 392 + 935 + 935, 392, 150, 150);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                }


                //选中路口四
                else if (this.CurSelectedIntersection == 3)
                {
                    if (PictureCountTime == 1)
                    {
                        Pen pen = new Pen(Color.Red, 1.5f);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 452, 452+935, 30, 30);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 2)
                    {
                        Pen pen = new Pen(Color.Red, 2);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 437, 437 + 935, 60, 60);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 3)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 422, 422 + 935, 90, 90);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 4)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 407, 407 + 935, 120, 120);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 5)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 392, 392 + 935, 150, 150);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                }


                 //选中路口五
                else if (this.CurSelectedIntersection == 4)
                {
                    if (PictureCountTime == 1)
                    {
                        Pen pen = new Pen(Color.Red, 1.5f);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 452 + 935, 452 + 935, 30, 30);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 2)
                    {
                        Pen pen = new Pen(Color.Red, 2);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 437 + 935, 437 + 935, 60, 60);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 3)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 422 + 935, 422 + 935, 90, 90);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 4)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 407 + 935, 407 + 935, 120, 120);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 5)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 392 + 935, 392 + 935, 150, 150);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                }


                //选中路口五 WYJ
                else if (this.CurSelectedIntersection == 5)
                {
                    if (PictureCountTime == 1)
                    {
                        Pen pen = new Pen(Color.Red, 1.5f);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 452 + 935 + 935, 452 + 935, 30, 30);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 2)
                    {
                        Pen pen = new Pen(Color.Red, 2);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 437 + 935 + 935, 437 + 935, 60, 60);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 3)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 422 + 935 + 935, 422 + 935, 90, 90);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 4)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 407 + 935 + 935, 407 + 935, 120, 120);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                    else if (PictureCountTime == 5)
                    {
                        Pen pen = new Pen(Color.Red, 3);//画笔颜色 
                        MapGraphics.DrawEllipse(pen, 392 + 935 + 935, 392 + 935, 150, 150);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                    }
                }


            }


            lock (this.Coordinates_i)
            {
                this.Coordinates_i.Clear();
                for (int j = 0; j < this.coordinates.Count; j++)
                {
                    Coordinate.gui_coordinate c = this.coordinates.ElementAt(j);
                    Coordinate.coordinate_i cit = new Coordinate.coordinate_i();
                    cit.ID = c.ID;
                    for (int i = Definitions.FrontMiddle; i <= Definitions.BackRight; i++)
                    {
                        //cit.X[i] = (int)Math.Round(c.X[i] * this.Ratio, 0);
                        //cit.Y[i] = (int)Math.Round(c.Y[i] * this.Ratio, 0);
                        //对车辆X、Y缩放
                        int wid = MainData.Map.GetLengthIntNum(); //路口宽度 3
                        int cn = c.IntersectionNumber;  //所在第几个路口
                        if (cn % wid == 0)
                        {
                            cit.X[i] = (int)Math.Round((c.X[i] + ((wid - 1) * 187)) * this.Ratio, 0);
                        }
                        else
                        {
                            cit.X[i] = (int)Math.Round((c.X[i] + ((cn % wid) - 1) * 187) * this.Ratio, 0);

                        }

                        if (cn % wid == 0)
                        {
                            if (cn / wid == 1)
                            {
                                cit.Y[i] = (int)Math.Round(c.Y[i] * this.Ratio, 0);
                            }
                            else
                            {
                                cit.Y[i] = (int)Math.Round((c.Y[i] + ((cn / wid) - 1) * 187) * this.Ratio, 0);
                            }
                        }
                        else
                        {
                            cit.Y[i] = (int)Math.Round((c.Y[i] + (cn / wid) * 187) * this.Ratio, 0);
                        }

                    }
                    this.Coordinates_i.Enqueue(cit);
                }
            }

            /*在虚拟画布上作图，坐标已经预存放在相关队列中*/
            while (this.coordinates.Count != 0)
            {
                Coordinate.gui_coordinate c = this.coordinates.Dequeue();
                try
                {
                    if (MapGraphics != null)
                    {
                        /*需要将车辆的具体坐标进行修正，转化成对应图形的左上角的坐标*/
                        for (int i = Definitions.FrontMiddle; i <= Definitions.BackRight; i++)
                        {


                            //对车辆X、Y缩放
                            int wid = MainData.Map.GetLengthIntNum(); //路口宽度 3
                            int cn = c.IntersectionNumber;  //所在第几个路口
                            if (cn % wid == 0)
                            {
                                X[i] = (int)Math.Round((c.X[i] + ((wid - 1) * 187)) * this.Ratio, 0);
                            }
                            else
                            {
                                X[i] = (int)Math.Round((c.X[i] + ((cn % wid) - 1) * 187) * this.Ratio, 0);
                             
                            }

                            if (cn % wid == 0)
                            {
                                if (cn / wid == 1)
                                {
                                    Y[i] = (int)Math.Round(c.Y[i] * this.Ratio, 0);                                    
                                }
                                else
                                {
                                    Y[i] = (int)Math.Round((c.Y[i] + ((cn / wid) - 1) * 187) * this.Ratio, 0); 
                                }
                            }
                            else
                            {
                                Y[i] = (int)Math.Round((c.Y[i] + (cn / wid) * 187) * this.Ratio, 0);
                            }
                                                        
                        }

                        /*绘制车辆图形*/
                        Point point1 = new Point(X[Definitions.FrontLeft], Y[Definitions.FrontLeft]);
                        Point point2 = new Point(X[Definitions.FrontRight], Y[Definitions.FrontRight]);
                        Point point3 = new Point(X[Definitions.BackRight], Y[Definitions.BackRight]);
                        Point point4 = new Point(X[Definitions.BackLeft], Y[Definitions.BackLeft]);

                        Point[] Points = { point1, point2, point3, point4 };
                        try
                        {
                            List<IntersectionPolicyConfig> PolicyConfigList = MainData.IntersectionAlgorithmList;
                            //拿到选中的路口
                            IntersectionPolicyConfig intersectionPolicyConfig = PolicyConfigList[this.CurSelectedIntersection];
                            //拿到所用策略
                            string PolicyString = intersectionPolicyConfig.GetPolicy();

                            //HQEP-SV存在优先级提升，车辆授权前后颜色变化与其他七种算法不同
                            if (PolicyString.Equals("HQEP-SV")) 
                            {
                                if (c.CurrentPriority == Definitions.Prio_High)
                                {
                                    if (c.IsAuthorized == true)
                                    {
                                        MapGraphics.FillPolygon(brush_become_high, Points);//Firebrick
                                    }
                                    else
                                    {
                                        MapGraphics.FillPolygon(brush_high, Points);//Red
                                    }
                                }
                                else if (c.CurrentPriority == Definitions.Prio_Mid)
                                {
                                    if (c.IsAuthorized == true)
                                    {
                                        MapGraphics.FillPolygon(brush_become_mid, Points);//Goldenrod
                                    }
                                    else
                                    {
                                        MapGraphics.FillPolygon(brush_mid, Points);//Yellow
                                    }
                                }
                                else
                                {
                                    #region
                                    if (c.CurrentPriority == Definitions.Prio_High)
                                    {
                                        if (c.IsAuthorized == true)
                                        {
                                            MapGraphics.FillPolygon(brush_become_high, Points);//Firebrick
                                        }
                                        else
                                        {
                                            MapGraphics.FillPolygon(brush_high, Points);//Red

                                        }
                                    }
                                    else if (c.CurrentPriority == Definitions.Prio_Mid)
                                    {
                                        if (c.IsAuthorized == true)
                                        {
                                            MapGraphics.FillPolygon(brush_become_mid, Points);//Goldenrod
                                        }
                                        else
                                        {
                                            MapGraphics.FillPolygon(brush_mid, Points);//Yellow
                                        }
                                    }
                                    else
                                    {
                                        if (c.IsAuthorized == false)
                                        {
                                            MapGraphics.FillPolygon(brush_low, Points);//Lime
                                        }
                                        else
                                        {
                                            SolidBrush brush_temp = new SolidBrush(Color.LimeGreen);
                                            MapGraphics.FillPolygon(brush_temp, Points);
                                        }
                                    }
                                    #endregion
                                    
                                }
                            }
                            else//其他七种算法车辆授权前后颜色变化如下
                            {
                                #region
                                if (c.CurrentPriority == Definitions.Prio_High)
                                {
                                    if (c.IsAuthorized == true)
                                    {
                                        MapGraphics.FillPolygon(brush_become_high, Points);//Firebrick
                                    }
                                    else
                                    {
                                        MapGraphics.FillPolygon(brush_high, Points);//Red

                                    }
                                }
                                else if (c.CurrentPriority == Definitions.Prio_Mid)
                                {
                                    if (c.IsAuthorized == true)
                                    {
                                        MapGraphics.FillPolygon(brush_become_mid, Points);//Goldenrod
                                    }
                                    else
                                    {
                                        MapGraphics.FillPolygon(brush_mid, Points);//Yellow
                                    }
                                }
                                else
                                {
                                    if (c.IsAuthorized == false)
                                    {
                                        MapGraphics.FillPolygon(brush_low, Points);//Lime
                                    }
                                    else
                                    {
                                        SolidBrush brush_temp = new SolidBrush(Color.LimeGreen);
                                        MapGraphics.FillPolygon(brush_temp, Points);
                                    }
                                }
                                #endregion

                            }

                        }
                        catch (Exception e)
                        {
                            return;
                        }

                        //选中车辆,绘制圈
                        if(this.CurSelectedID!="")
                        {
                            if (c.ID.Equals(this.CurSelectedID)) 
                            {
                               //计算横坐标X 纵坐标Y
                                int x = 0;
                                int y = 0;
                                if (X[Definitions.FrontLeft] != X[Definitions.FrontRight])   //竖着的车辆
                                {
                                    x = (X[Definitions.FrontLeft] + X[Definitions.FrontRight]) / 2;
                                    y = (Y[Definitions.BackRight] + Y[Definitions.FrontRight]) / 2;                                     
                                }
                                else   //哼着的车辆
                                {
                                    x = (X[Definitions.FrontLeft] + X[Definitions.BackRight]) / 2;
                                    y = (Y[Definitions.FrontLeft] + Y[Definitions.FrontRight]) / 2;
                                }
                                
                                x -= 15;
                                y -= 15;
                                Pen pentemp = new Pen(Color.Red, 2);//画笔颜色 
                                MapGraphics.DrawEllipse(pentemp, x, y, 30, 30);//画椭圆的方法，x坐标、y坐标、宽、高，如果是100，则半径为50
                            }
                        }



                    }
                }
                catch (Exception e)
                {
                    return;
                }
            }

            /*向完成绘图后的虚拟画布贴在当前的窗体上，这样可以解决动画显示时出现的画面闪烁*/
            try
            {
                Graphics g = this.BackgroundPanel.CreateGraphics();
                IntPtr hdcPtr = g.GetHdc();
                IntPtr memdcPtr = CreateCompatibleDC(hdcPtr);   // 创建兼容DC  
                IntPtr bmpPtr = BackgroundBitmap.GetHbitmap();
                SelectObject(memdcPtr, bmpPtr);
                BitBlt(hdcPtr, 0, 0, BackgroundBitmap.Width, BackgroundBitmap.Height, memdcPtr, 0, 0, SRCCOPY);
                DeleteDC(memdcPtr);             // 释放内存  
                DeleteObject(bmpPtr);           // 释放内存  
                g.ReleaseHdc(hdcPtr);           // 释放内存  
                g.Dispose();
                BackgroundBitmap.Dispose();
                //this.BackgroundPanel.CreateGraphics().DrawImage(BackgroundBitmap, 0, 0);

                this.showSelectedVehicleInformation(this.CurSelectedID);   //显示选中车辆的信息
                this.showSelectedIntersectionInformation(this.CurSelectedIntersection); //显示选中路口的授权信息
                this.showLaneCSIDInformation();    //显示Lane上的车辆信息
                this.ShowLaneWeight();
            }
            catch (System.Exception e)
            {
                return;
            }

            //释放资源
            //BackgroundBitmap.Dispose();
            //MapGraphics.Dispose();                       
        }



        //记录DisplayForm界面配置信息
        public void RecordFormInformation() 
        {        
            //单个度调度算法
            //MainData.FormConfig.SetFAFPSV(this.FAFPSV.Checked);
            //MainData.FormConfig.SetFAFPSQ(this.FAFPSQ.Checked);
            //MainData.FormConfig.SetFAFPSQSV(this.FAFPSQSV.Checked);
            //MainData.FormConfig.SetFAFPMQ(this.FAFPMQ.Checked);

            //MainData.FormConfig.SetHQEPSV(this.HQEPSV.Checked);
            //MainData.FormConfig.SetHWFPSQ(this.HWFPSQ.Checked);
            //MainData.FormConfig.SetHWFPSQSV(this.HWFPSQSV.Checked);
            //MainData.FormConfig.SetHWFPMQ(this.HWFPMQ.Checked);

            //全局调度算法
            MainData.FormConfig.SetDijkstraS(this.DijsktraS.Checked);
            MainData.FormConfig.SetDijkstraD(this.DijsktraD.Checked);

            //一次授权数量
            int AuthNumber = int.Parse(VehicleNums.SelectedItem.ToString());
            MainData.FormConfig.SetAuthorizeVehicleNumber(AuthNumber);


            //全局的调度算法
            MainData.FormConfig.SetDijkstraD(this.DijsktraD.Checked);
            MainData.FormConfig.SetDijkstraS(this.DijsktraS.Checked);

        }


        //点击ShowVI控件 显示车辆CSID信息
        public void ShowVICheckedChanged(object sender, EventArgs e) 
        {
            if (ShowVI.Checked)
            {
                LaneIntersection1Label1.Visible = true;
                LaneIntersection1Label2.Visible = true;
                LaneIntersection1Label3.Visible = true;
                LaneIntersection1Label4.Visible = true;
                LaneIntersection2Label1.Visible = true;
                LaneIntersection2Label2.Visible = true;
                LaneIntersection2Label3.Visible = true;
                LaneIntersection2Label4.Visible = true;
                LaneIntersection3Label1.Visible = true;
                LaneIntersection3Label2.Visible = true;
                LaneIntersection3Label3.Visible = true;
                LaneIntersection3Label4.Visible = true;
                LaneIntersection4Label1.Visible = true;
                LaneIntersection4Label2.Visible = true;
                LaneIntersection4Label3.Visible = true;
                LaneIntersection4Label4.Visible = true;
                LaneIntersection5Label1.Visible = true;
                LaneIntersection5Label2.Visible = true;
                LaneIntersection5Label3.Visible = true;
                LaneIntersection5Label4.Visible = true;
                LaneIntersection6Label1.Visible = true;
                LaneIntersection6Label2.Visible = true;
                LaneIntersection6Label3.Visible = true;
                LaneIntersection6Label4.Visible = true; 
            }
            else 
            {
                LaneIntersection1Label1.Visible =false;
                LaneIntersection1Label2.Visible = false;
                LaneIntersection1Label3.Visible = false;
                LaneIntersection1Label4.Visible = false;
                LaneIntersection2Label1.Visible = false;
                LaneIntersection2Label2.Visible = false;
                LaneIntersection2Label3.Visible = false;
                LaneIntersection2Label4.Visible = false;
                LaneIntersection3Label1.Visible = false;
                LaneIntersection3Label2.Visible = false;
                LaneIntersection3Label3.Visible = false;
                LaneIntersection3Label4.Visible = false;
                LaneIntersection4Label1.Visible = false;
                LaneIntersection4Label2.Visible = false;
                LaneIntersection4Label3.Visible = false;
                LaneIntersection4Label4.Visible = false;
                LaneIntersection5Label1.Visible = false;
                LaneIntersection5Label2.Visible = false;
                LaneIntersection5Label3.Visible = false;
                LaneIntersection5Label4.Visible = false;
                LaneIntersection6Label1.Visible = false;
                LaneIntersection6Label2.Visible = false;
                LaneIntersection6Label3.Visible = false;
                LaneIntersection6Label4.Visible = false; 
            }
        }

        //点击ShowII控件
        public void ShowIICheckedChanged(object sender, EventArgs e)
        {
            if (ShowII.Checked)
            {
                AuthrizeTextBox.Visible = true;    
                AgentNumberLabel.Visible = true;
                AgentInformationGroup.Visible = true;  
            }
            else 
            {
                AuthrizeTextBox.Visible = false;
                AgentNumberLabel.Visible = false;
                AgentInformationGroup.Visible = false;  
            }
        }


        //选择策略时联动
        private void PolicySelectedIndexChanged(object sender, EventArgs e)
        {
            string TempPolicy = IntersectionPolicy.SelectedItem.ToString();
            if (TempPolicy.Equals("FAFP-SV") || TempPolicy.Equals("HQEP-SV"))
            {
                VehicleNums.SelectedIndex = 0;
                VehicleNums.Enabled = false;
            }
            else 
            {
                VehicleNums.Enabled = true;
            }
        }

        //选择调度策略
        //点击ApplyButtonClick
        private void ApplyButtonClick(object sender, EventArgs e) 
        {
            //从下拉菜单等控件得到调度策略
            string TempSerialNum = IntersectionSerialNumber.SelectedItem.ToString();
            string TempPolicy = IntersectionPolicy.SelectedItem.ToString();
            string TempNums = VehicleNums.SelectedItem.ToString();

            
            //将选择的策略写入List中
            if (TempSerialNum.Equals("All"))
            {
                for (int i = 1; i <= 6; i++)
                {
                    //显示到界面上
                    if (i==1)
                    {
                        IntersectionPolicy1.Text = TempPolicy + "  " + TempNums;
                    }
                    else if (i == 2)
                    {
                        IntersectionPolicy2.Text = TempPolicy + "  " + TempNums;
                    }
                    else if (i == 3)
                    {
                        IntersectionPolicy3.Text = TempPolicy + "  " + TempNums;
                    }
                    else if (i == 4)
                    {
                        IntersectionPolicy4.Text = TempPolicy + "  " + TempNums;
                    }
                    else if (i == 5)
                    {
                        IntersectionPolicy5.Text = TempPolicy + "  " + TempNums;
                    }
                    else if (i == 6)
                    {
                        IntersectionPolicy6.Text = TempPolicy + "  " + TempNums;
                    }

                    //写入变量中
                    IntersectionPolicyConfig IntersectionPolicyConfig = new IntersectionPolicyConfig();
                    IntersectionPolicyConfig.SetAuthorization(int.Parse(TempNums));
                    IntersectionPolicyConfig.SetPolicy(TempPolicy);
                    IntersectionPolicyConfig.SetIntersectionSerialNum(i);
                    MainData.IntersectionAlgorithmList.Add(IntersectionPolicyConfig);
                }
            }
            else 
            {
                //显示到界面上
                if (TempSerialNum.Equals("1")) 
                {
                    IntersectionPolicy1.Text = TempPolicy + "  " + TempNums;
                }
                else if (TempSerialNum.Equals("2"))
                {
                    IntersectionPolicy2.Text = TempPolicy + "  " + TempNums;
                }
                else if (TempSerialNum.Equals("3"))
                {
                    IntersectionPolicy3.Text = TempPolicy + "  " + TempNums;
                }
                else if (TempSerialNum.Equals("4"))
                {
                    IntersectionPolicy4.Text = TempPolicy + "  " + TempNums;
                }
                else if (TempSerialNum.Equals("5"))
                {
                    IntersectionPolicy5.Text = TempPolicy + "  " + TempNums;
                }
                else if (TempSerialNum.Equals("6"))
                {
                    IntersectionPolicy6.Text = TempPolicy + "  " + TempNums;
                }

                //写入变量中
                IntersectionPolicyConfig IntersectionPolicyConfig = new IntersectionPolicyConfig();
                IntersectionPolicyConfig.SetAuthorization(int.Parse(TempNums));
                IntersectionPolicyConfig.SetPolicy(TempPolicy);
                IntersectionPolicyConfig.SetIntersectionSerialNum(int.Parse(TempSerialNum));
                MainData.IntersectionAlgorithmList.Add(IntersectionPolicyConfig);
            }
        }


        //点击重置按钮
        private void ResetButtonClick(object sender, EventArgs e) 
        {
            //界面
            IntersectionPolicy1.Text = "";
            IntersectionPolicy2.Text = "";
            IntersectionPolicy3.Text = "";
            IntersectionPolicy4.Text = "";
            IntersectionPolicy5.Text = "";
            IntersectionPolicy6.Text = "";

            //数据
            MainData.IntersectionAlgorithmList.Clear();
        }

        /// <summary>
        /// 点击开始按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StartButtonClick(object sender, EventArgs e)
        {
            //记录DisplayForm界面配置信息
            RecordFormInformation();

            //点击之后控件将不可点击
            this.StartButton.Enabled = false;
            //仿真线程,同时负责整个界面的显示，包括背景、车辆
            SimulationThread = new Thread(new ThreadStart(this.StartSimulationButton_Thread));
            //进度条线程，负责进度条的更新
            ProgressBarThread = new Thread(new ThreadStart(this.UpdateProgressBar));
            //开启仿真线程
            SimulationThread.Start();
           
        }

        /// <summary>
        /// 点击暂停按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SuspendButtonClick(object sender, EventArgs e) 
        {         
            if (this.SuspendButton.Text == "Suspend")
            {
                this.SuspendButton.Text = "Resume";
                resetEvent.Reset();
            }
            else
            {
                this.SuspendButton.Text = "Suspend";
                resetEvent.Set();
            }

        }


        /************************************************************************/
        /* 负责整个界面的显示，包括背景、车辆的显示
         * 首先进行一个时间片的车辆的运行，调度器的调度（调用main.cs）
         * 之后可按照车辆的位置进行显示*/
        /************************************************************************/
        private void StartSimulationButton_Thread()
        {         

            //清空AtoV消息队列缓冲区
            foreach (Intersection Intersection in MainData.CEIntersectionList)
            {
                List<CyberCarSimulation.Bean.Message> AtoV_BufferTemp = Intersection.GetAtoV_Buffer();
                AtoV_BufferTemp.Clear();
                Intersection.SetAtoV_Buffer(AtoV_BufferTemp);  //写回去
            }

            //清空VtoA消息队列缓冲区
            foreach (Intersection Intersection in MainData.CEIntersectionList)
            {
                List<CyberCarSimulation.Bean.Message> VtoA_BufferTemp = Intersection.GetVtoA_Buffer();
                VtoA_BufferTemp.Clear();
                Intersection.SetVtoA_Buffer(VtoA_BufferTemp); //写回去
            }

            //初始化仿真Main类对象
            MainSim = new Main();

            /************************************************************************/
            /* 功能：按照仿真规则对每一个时间片进行仿真。  
             * 步骤划分：1、对时间片进行划分，每一次循环既是一个时间片   
             *           2、在一个时间片中，遍历每一辆车与每一个临界区的消息队列，完成一个时间片内的动作   
             * 循环满足条件：1、车道车辆未空
             *               2、总时间未超过规定的仿真时间
             */
            /************************************************************************/
            //待测算法
            while (!(this.isVehicleQueueEmpty()) && Main.GetGlobalTime() <= 3000000.0f)
            {
                resetEvent.WaitOne();
                if (this.Visible == false || SimulationThread.IsAlive == false)
                {
                    return;
                }

                try
                {
                    MainSim.Simulation();
                }
                catch (Exception e)
                {
                    Console.Out.Write(e.GetType());
                    Console.Out.Write(e.ToString());
                    return;
                }

                try
                {
                    DrawBackground();

                    //DrawCar111();
                    //Test
                    //DateTime beforDT = System.DateTime.Now;
                    //DrawBackground();
                    //DateTime afterDT = System.DateTime.Now;
                    //TimeSpan ts = afterDT.Subtract(beforDT);
                    //Console.WriteLine("DateTime总共花费{0}ms.", ts.TotalMilliseconds);  
                }
                catch (Exception e)
                {
                    Console.Out.Write(e.GetType());
                    Console.Out.Write(e.ToString());
                    return;
                }


            }
        }


        /************************************************************************/
        /* 检测未插入车辆队列是否为空                                                                     */
        /************************************************************************/
        public bool isVehicleQueueEmpty()
        {
            //进入车道、中间车道标志位
            bool flageInterset = true;
            bool flagEnterLane = true;
            bool flagCenterLane = true;
            bool flagLeaveLane = true;

            foreach (Lane Lane in MainData.EnterLaneList)
            {
                if (Lane.GetVehicleQueue().Count != 0)
                {
                    flageInterset = false;
                }
            }

            //判断所有的车道都十分有车 分为进入车道 中间车道 离开车道
            foreach (Lane Lane in MainData.EnterLaneList)
            {
                if (Lane.GetVehicleList().Count() != 0)
                {
                    flagEnterLane = false;
                }
            }

            //判断所有的车道都十分有车 分为进入车道 中间车道 离开车道
            foreach (Lane Lane in MainData.CenterLaneList)
            {
                if (Lane.GetVehicleList().Count() != 0)
                {
                    flagCenterLane = false;
                }
            }

            //判断所有的车道都十分有车 分为进入车道 中间车道 离开车道
            foreach (Lane Lane in MainData.LeaveLaneList) 
            {
                if (Lane.GetVehicleList().Count() != 0)
                {
                    flagLeaveLane = false;
                }
            }

            //根据标志位，判断是否返回全部为空
            if (MainData.Map.GlobalVehicleList.Count == 0 && flageInterset == true &&
                flagEnterLane == true && flagCenterLane == true && flagLeaveLane == true)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        private void UpdateProgressBar()
        {


        }


        //点击关闭按钮
        private void FormClosingEventArgs(object sender, FormClosingEventArgs e)
        {
            SimulationThread.IsBackground = true;
            System.Environment.Exit(0);
            ////弹出对话框，提示用户关闭
            //DialogResult Result = MessageBox.Show("Are you sure to close the windows ?", "",
            //    MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            ////点击确定关闭按钮
            //if (Result == DialogResult.OK)
            //{
            //    e.Cancel = true;
            //    SimulationThread.IsBackground = true;
            //    System.Environment.Exit(0);
            //    return;
            //}
            //else
            //{
            //   // e.Cancel = false;
            //   // SimulationThread.IsBackground = true;
            //   // System.Environment.Exit(0);
            //   // return;
            //}            
        }


         /************************************************************************/
        /* 显示当前选中车辆的信息                                                                     */
        /************************************************************************/
        private void showSelectedVehicleInformation(string CurSelectedID)
        {
            if (SimulationThread.IsAlive == false || this.Visible == false)
            {
                /*仿真线程被激活或是窗体消失，本线程结束*/
                return;
            }
            this.isSelectedVehicleInQueue = false;
            foreach (Vehicle vtmp in MainData.Map.GlobalVehicleList)
            {
                if (vtmp.Get_ID() == CurSelectedID)
                {

                    //更新ID标签
                    /*更新车辆位置标签*/
                    if (this.VehicleIDTX.InvokeRequired)
                    {
                        this.VehicleIDTX.Invoke(new MethodInvoker(delegate
                        {
                            this.VehicleIDTX.Text = CurSelectedID;                           
                        }));
                    }
                    else
                    {
                        this.VehicleIDTX.Text = CurSelectedID;
                    }
                      

                    //更新X标签
                    /*更新车辆位置标签*/
                    if (this.VehicleTypeTX.InvokeRequired)
                    {
                        this.VehicleTypeTX.Invoke(new MethodInvoker(delegate
                        {
                            this.VehicleTypeTX.Text = vtmp.Get_Cartype().ToString();
                        }));
                    }
                    else
                    {
                        this.VehicleTypeTX.Text = vtmp.Get_Cartype().ToString();
                    }

                    

                    //更新车辆速度
                    if (this.VehicleSpeedTX.InvokeRequired)
                    {
                        this.VehicleSpeedTX.Invoke(new MethodInvoker(delegate
                        {
                            float speed = vtmp.Get_Current_Speed();
                            this.VehicleSpeedTX.Text = Math.Round(speed).ToString();
                        }));
                    }
                    else
                    {
                        float speed = vtmp.Get_Current_Speed();
                        this.VehicleSpeedTX.Text = Math.Round(speed).ToString();
                    }


                    //更新路径
                    if (this.VehiclePathTX.InvokeRequired)
                    {
                        this.VehiclePathTX.Invoke(new MethodInvoker(delegate
                        {                            
                            string OriginIDNum = vtmp.Get_LaneIDOrigin().ToString();
                            string FinalIDNum = vtmp.Get_LaneIDFinal().ToString();
                            this.VehiclePathTX.Text = OriginIDNum + "-" + vtmp.GetPathNumber() + "-" + FinalIDNum;
                        }));
                    }
                    else
                    {
                        string OriginIDNum = vtmp.Get_LaneIDOrigin().ToString();
                        string FinalIDNum = vtmp.Get_LaneIDFinal().ToString();
                        this.VehiclePathTX.Text = OriginIDNum + "-" + vtmp.GetPathNumber() + "-" + FinalIDNum;
                    }



                    //更新Lane
                    if (this.VehicleLaneTX.InvokeRequired)
                    {
                        this.VehicleLaneTX.Invoke(new MethodInvoker(delegate
                        {
                            this.VehicleLaneTX.Text = vtmp.Get_LaneID().ToString();
                        }));
                    }
                    else
                    {
                        this.VehicleLaneTX.Text = vtmp.Get_LaneID().ToString();
                    }


                    //更新Intersection
                    if (this.VehicleIntersectionTX.InvokeRequired)
                    {
                        this.VehicleIntersectionTX.Invoke(new MethodInvoker(delegate
                        {
                            this.VehicleIntersectionTX.Text = vtmp.GetIntersectionNumber().ToString();
                        }));
                    }
                    else
                    {
                        this.VehicleIntersectionTX.Text = vtmp.GetIntersectionNumber().ToString();
                    }
                    
                    
                    //更新前车信息
                    if (this.VehicleFrontCarTX.InvokeRequired)
                    {
                        this.VehicleFrontCarTX.Invoke(new MethodInvoker(delegate
                        {
                            if (vtmp.Get_Front_ID() != null)
                            {
                                this.VehicleFrontCarTX.Text = vtmp.Get_Front_ID().ToString();
                            }
                            else 
                            {
                                this.VehicleFrontCarTX.Text = "";
                            }
                            
                        }));
                    }
                    else
                    {
                        if (vtmp.Get_Front_ID() != null)
                        {
                            this.VehicleFrontCarTX.Text = vtmp.Get_Front_ID().ToString();
                        }
                        else
                        {
                            this.VehicleFrontCarTX.Text = "";
                        }
                    }   
                    
               


                    //更新加速度
                    if (this.VehicleAccSpeedTX.InvokeRequired)
                    {
                        this.VehicleAccSpeedTX.Invoke(new MethodInvoker(delegate
                        {
                            this.VehicleAccSpeedTX.Text = vtmp.Get_Current_Acceleration().ToString();
                        }));
                    }
                    else
                    {
                        this.VehicleAccSpeedTX.Text = vtmp.Get_Current_Acceleration().ToString();
                    }



                    //绘制速度曲线
                    if (this.SpeedChart.InvokeRequired)
                    {
                        this.SpeedChart.Invoke(new MethodInvoker(delegate
                        {
                            for (int i = 0; i < this.SpeedChartPointsNum - 1; i++)
                            {
                                SpeedPoints[i] = SpeedPoints[i + 1];
                            }
                            SpeedPoints[SpeedChartPointsNum - 1] = vtmp.Get_Current_Speed();

                            this.SpeedChart.Series[0].Points.Clear();
                            for (int i = 0; i < SpeedChartPointsNum; i++)
                            {
                                //                                this.SpeedChart.Series[0].Points.AddXY(i, SpeedChart[i]);
                                this.SpeedChart.Series[0].Points.AddY(SpeedPoints[i]);
                            }

                            if (this.SelectedID != this.CurSelectedID || vtmp.Get_Total_Distance() >= Coordinate.IntersactionDelLine)
                            {
                                /*更换被选择的车辆，从图表中清除原先的数据*/
                                this.SelectedID = this.CurSelectedID;
                                this.SpeedChart.Series[0].Points.Clear();
                                for (int i = 0; i < SpeedChartPointsNum; i++)
                                {
                                    SpeedPoints[i] = 0;
                                }
                            }
                        }));

                    }
                    else 
                    {

                    }



                    /*绘制加速度曲线*/
                    if (this.Accchart.InvokeRequired)
                    {
                        this.Accchart.Invoke(new MethodInvoker(delegate
                        {
                            for (int i = 0; i < this.AccChartPointsNum - 1; i++)
                            {
                                AccPoints[i] = AccPoints[i + 1];
                            }
                            AccPoints[AccChartPointsNum - 1] = vtmp.Get_Current_Acceleration();

                            this.Accchart.Series[0].Points.Clear();
                            for (int i = 0; i < AccChartPointsNum; i++)
                            {
                                //  this.SpeedChart.Series[0].Points.AddXY(i, SpeedChart[i]);
                                this.Accchart.Series[0].Points.AddY(AccPoints[i]);
                            }

                            if (this.SelectedID != this.CurSelectedID || vtmp.Get_Total_Distance() >= Coordinate.IntersactionDelLine)
                            {
                                /*更换被选择的车辆，从图表中清除原先的数据*/
                                this.SelectedID = this.CurSelectedID;
                                this.Accchart.Series[0].Points.Clear();
                                for (int i = 0; i < AccChartPointsNum; i++)
                                {
                                    AccPoints[i] = 0;
                                }
                            }
                        }));
                    }
                    else
                    {
                        for (int i = 0; i < this.AccChartPointsNum - 1; i++)
                        {
                            AccPoints[i] = AccPoints[i + 1];
                        }
                        AccPoints[AccChartPointsNum - 1] = vtmp.Get_Current_Acceleration();

                        this.Accchart.Series[0].Points.Clear();
                        for (int i = 0; i < AccChartPointsNum; i++)
                        {
                            //  this.SpeedChart.Series[0].Points.AddXY(i, SpeedChart[i]);
                            this.Accchart.Series[0].Points.AddY(AccPoints[i]);
                        }

                        if (this.SelectedID != this.CurSelectedID || vtmp.Get_Total_Distance() >= Coordinate.IntersactionDelLine)
                        {
                            /*更换被选择的车辆，从图表中清除原先的数据*/
                            this.SelectedID = this.CurSelectedID;
                            this.Accchart.Series[0].Points.Clear();
                            for (int i = 0; i < AccChartPointsNum; i++)
                            {
                                AccPoints[i] = 0;
                            }
                        }

                    }
                    ///*绘制速度曲线*/
                    //if (this.SpeedChart.InvokeRequired)
                    //{
                    //    this.SpeedChart.Invoke(new MethodInvoker(delegate
                    //    {
                    //        for (int i = 0; i < this.SpeedChartPointsNum - 1; i++)
                    //        {
                    //            SpeedPoints[i] = SpeedPoints[i + 1];
                    //        }
                    //        SpeedPoints[SpeedChartPointsNum - 1] = vtmp.Get_Current_Speed();

                    //        this.SpeedChart.Series[0].Points.Clear();
                    //        for (int i = 0; i < SpeedChartPointsNum; i++)
                    //        {
                    //            //                                this.SpeedChart.Series[0].Points.AddXY(i, SpeedChart[i]);
                    //            this.SpeedChart.Series[0].Points.AddY(SpeedPoints[i]);
                    //        }

                    //        if (this.SelectedID != this.CurSelectedID || vtmp.Get_Total_Distance() >= Coordinate.IntersactionDelLine)
                    //        {
                    //            /*更换被选择的车辆，从图表中清除原先的数据*/
                    //            this.SelectedID = this.CurSelectedID;
                    //            this.SpeedChart.Series[0].Points.Clear();
                    //            for (int i = 0; i < SpeedChartPointsNum; i++)
                    //            {
                    //                SpeedPoints[i] = 0;
                    //            }
                    //        }
                    //    }));
                    //}
                    //else
                    //{
                    //    for (int i = 0; i < SpeedChartPointsNum - 1; i++)
                    //    {
                    //        SpeedPoints[i] = SpeedPoints[i + 1];
                    //    }
                    //    SpeedPoints[SpeedChartPointsNum - 1] = vtmp.Get_Current_Speed();

                    //    this.SpeedChart.Series[0].Points.Clear();
                    //    for (int i = 0; i < SpeedChartPointsNum; i++)
                    //    {
                    //        //                            this.SpeedChart.Series[0].Points.AddXY(i, SpeedChart[i]);
                    //        this.SpeedChart.Series[0].Points.AddY(SpeedPoints[i]);
                    //    }
                    //    if (this.SelectedID != this.CurSelectedID || vtmp.Get_Total_Distance() >= Coordinate.IntersactionDelLine)
                    //    {
                    //        /*更换被选择的车辆，从图表中清除原先的数据*/
                    //        this.SelectedID = this.CurSelectedID;
                    //        this.SpeedChart.Series[0].Points.Clear();
                    //        for (int i = 0; i < SpeedChartPointsNum; i++)
                    //        {
                    //            SpeedPoints[i] = 0;
                    //        }
                    //    }
                    //}



                }
            }
        }


          /************************************************************************/
        /* 显示当前选中车辆的信息                                                                     */
        /************************************************************************/
        private void showSelectedIntersectionInformation(int CurSelectedIntersection)
        {

            //在界面上显示当前调度器的授权信息    Authrized Information所显示的内容
            if (this.AuthrizeTextBox.InvokeRequired)
            {
                this.AuthrizeTextBox.Invoke(new MethodInvoker(delegate
                {
                    this.AuthrizeTextBox.Text = "";
                    this.AgentNumberLabel.Text = "";
                    Dictionary<int, List<string>> Authorize_CS_to_Vehicle = new Dictionary<int, List<string>>();     //用于存储当前车辆的授权情况



                    //从这里开始写代码Start

                    //存储着哪个路口使用哪种算法的变量
                    List<IntersectionPolicyConfig> PolicyConfigList = MainData.IntersectionAlgorithmList;

                    //拿到选中的路口
                   IntersectionPolicyConfig intersectionPolicyConfig = PolicyConfigList[this.CurSelectedIntersection];

                   //拿到对应的策略
                   string PolicyString = intersectionPolicyConfig.GetPolicy();

                    //处理FAFP-SV（这个比较复杂，可以先不用管，而且可能还有BUG)
                   if (PolicyString.Equals("FAFP-SV")) 
                   {
                       //二次封装
                       Dictionary<int, List<string>> Authorize_CS_to_VehicleTemp = new Dictionary<int, List<string>>(); 
                       Dictionary<int, string> Dictionary = MainData.CEIntersectionList[this.CurSelectedIntersection].GetMultiSCSFIFOSche().GetAuthorize_CS_to_Vehicle();
                       for (int i = 1; i <= 4; i++) 
                       {
                           List<String> strList = new List<string>();
                           if (Dictionary.Keys.Contains(i))
                           {                                                              
                               strList.Add(Dictionary[i]);                              
                           }
                           if (strList.Count != 0)
                           {
                               Authorize_CS_to_VehicleTemp.Add(i, strList);
                           }
                       }
                       Authorize_CS_to_Vehicle = Authorize_CS_to_VehicleTemp;
                   }
                   //处理FAFP-SQ
                   else if (PolicyString.Equals("FAFP-SQ"))
                   {
                       Authorize_CS_to_Vehicle = MainData.CEIntersectionList[this.CurSelectedIntersection].GetFIFOSingleQueue_Sche().GetAuthorize_CS_to_Vehicle();
                   }
                   
                   //处理FAFP-MQ
                   else if (PolicyString.Equals("FAFP-MQ")) 
                   {
                       Authorize_CS_to_Vehicle = MainData.CEIntersectionList[this.CurSelectedIntersection].GetFIFOMultiQueue_Sche().GetAuthorize_CS_to_Vehicle();
                   }
                  
                   //处理HWFP-SQ-SV
                   else if (PolicyString.Equals("HWFP-SQ-SV"))
                   {
                       //雨佳补写这里
                       Authorize_CS_to_Vehicle = MainData.CEIntersectionList[this.CurSelectedIntersection].GetPriorSingleQueueSingleVehicle_Sche().GetAuthorize_CS_to_Vehicle();
                   }                      

                   
                   else if (PolicyString.Equals("HQEP-SV")) 
                   {
                       //二次封装
                       Dictionary<int, List<string>> Authorize_CS_to_VehicleTemp = new Dictionary<int, List<string>>();
                       Dictionary<int, string> Dictionary = MainData.CEIntersectionList[this.CurSelectedIntersection].GetMultiSCSPrioFIFO_Sche().GetAuthorize_CS_to_Vehicle();
                       for (int i = 1; i <= 4; i++)
                       {
                           List<String> strList = new List<string>();
                           if (Dictionary.Keys.Contains(i))
                           {
                               strList.Add(Dictionary[i]);
                           }
                           if (strList.Count != 0)
                           {
                               Authorize_CS_to_VehicleTemp.Add(i, strList);
                           }
                       }
                       Authorize_CS_to_Vehicle = Authorize_CS_to_VehicleTemp;

                   }

                    //代码结束

                        //根据不同算法去不同的授权数据  ***********增加算法记得修改这里，否则Agent不显示授权信息
                        //if (IntersectionPolicyConfig.get)
                        //Authorize_CS_to_Vehicle = MainData.CEIntersectionList[this.CurSelectedIntersection].GetPriorSingleQueueSingleVehicle_Sche().GetAuthorize_CS_to_Vehicle();
                    //if (MainData.FormConfig.GetHWFPSQ()) {
                    //    Authorize_CS_to_Vehicle = MainData.CEIntersectionList[this.CurSelectedIntersection].GetPriorSingleQueue_Sche().GetAuthorize_CS_to_Vehicle();
                    //}
                    //else if (MainData.FormConfig.GetHWFPSQSV())
                    //{
                    //    Authorize_CS_to_Vehicle = MainData.CEIntersectionList[this.CurSelectedIntersection].GetPriorSingleQueueSingleVehicle_Sche().GetAuthorize_CS_to_Vehicle();
                    //}



                   for (int i = 1; i <= 4; i++)
                   {
                       if (Authorize_CS_to_Vehicle != null)
                       {
                           //continue;
                       }
                       else
                       {
                           break;
                       }

                       if (Authorize_CS_to_Vehicle.Count != 0)
                       {

                           if (Authorize_CS_to_Vehicle.Keys.Contains(i))
                           {
                               string Show_ID_tmp = null;
                               foreach (string s in Authorize_CS_to_Vehicle[i])
                               {
                                   if (Authorize_CS_to_Vehicle[i] != null)
                                   {
                                       //continue;
                                   }
                                   else
                                   {
                                       break;
                                   }

                                   Show_ID_tmp = Authorize_CS_to_Vehicle[i].ElementAt(0).ToString();
                                   for (int ListIndex = 1; ListIndex < Authorize_CS_to_Vehicle[i].Count; ListIndex++)
                                   {
                                       Show_ID_tmp = Show_ID_tmp + " \r\n" + "        " + Authorize_CS_to_Vehicle[i].ElementAt(ListIndex).ToString();
                                   }

                                   Show_ID_tmp = "CSID" + i.ToString() + "   " + Show_ID_tmp;
                               }
                               this.AuthrizeTextBox.Text += Show_ID_tmp + "\r\n";
                               //this.AuthrizeLabel.Text = i.ToString() + "   " + this.AuthrizeLabel.Text;

                               //this.CSIDLabel.Text += i.ToString() + "\n";
                               this.AgentNumberLabel.Text = "Intersection Number: " + (this.CurSelectedIntersection + 1);
                           }

                       }
                       else
                       {
                           break;
                       }

                   }
                }));
            }

        }
          
        

        //显示车道上的车辆需要的CSID
        public void showLaneCSIDInformation() 
        {
            //拿到对应的车道队列
            List<Lane> LaneTemp = MainData.CEIntersectionList[0].GetEnterIntLaneList();
            List<Vehicle> VehicleTemp = LaneTemp[0].GetVehicleList();

            //用于给Label显示车辆信息字符串
            string NtoSStr = "NtoSLane:\r\n\r\nCarID       CSID\r\n";                    

            for (int i = 0; i < VehicleTemp.Count; i++) 
            {
                Vehicle v = VehicleTemp[i];
                NtoSStr +=v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
           
            /*更新车辆信息标签*/
            if (this.LaneIntersection1Label1.InvokeRequired)
            {
                this.LaneIntersection1Label1.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection1Label1.Text = NtoSStr;
                }));
            }
            else
            {
                this.LaneIntersection1Label1.Text = NtoSStr;
            }



            //显示Intersection1的WtoE车道信息
            string WtoEStr = "WtoELane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[1].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                WtoEStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection1Label2.InvokeRequired)
            {
                this.LaneIntersection1Label2.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection1Label2.Text = WtoEStr;
                }));
            }
            else
            {
                this.LaneIntersection1Label2.Text = WtoEStr;
            }


            //显示Intersection1的EtoW车道信息
            string EtoWStr = "EtoWLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[2].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                EtoWStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection1Label3.InvokeRequired)
            {
                this.LaneIntersection1Label3.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection1Label3.Text = EtoWStr;
                }));
            }
            else
            {
                this.LaneIntersection1Label3.Text = EtoWStr;
            }

            //显示Intersection1的StoN车道信息
            string StoNStr = "StoNLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[3].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                StoNStr +=v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection1Label4.InvokeRequired)
            {
                this.LaneIntersection1Label4.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection1Label4.Text = StoNStr;
                }));
            }
            else
            {
                this.LaneIntersection1Label4.Text = StoNStr;
            }






           /***********第二个路口**************/
            //显示Intersection1的WtoE车道信息
            LaneTemp = MainData.CEIntersectionList[1].GetEnterIntLaneList();
            VehicleTemp = LaneTemp[0].GetVehicleList();

            //用于给Label显示车辆信息字符串
            NtoSStr = "NtoSLane:\r\n\r\nCarID       CSID\r\n";
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                NtoSStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection2Label1.InvokeRequired)
            {
                this.LaneIntersection2Label1.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection2Label1.Text = NtoSStr;
                }));
            }
            else
            {
                this.LaneIntersection2Label1.Text = NtoSStr;
            }


            //显示Intersection1的WtoE车道信息
            WtoEStr = "WtoELane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[1].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                WtoEStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection2Label2.InvokeRequired)
            {
                this.LaneIntersection2Label2.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection2Label2.Text = WtoEStr;
                }));
            }
            else
            {
                this.LaneIntersection2Label2.Text = WtoEStr;
            }


            //显示Intersection1的EtoW车道信息
            EtoWStr = "EtoWLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[2].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                EtoWStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection2Label3.InvokeRequired)
            {
                this.LaneIntersection2Label3.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection2Label3.Text = EtoWStr;
                }));
            }
            else
            {
                this.LaneIntersection2Label3.Text = EtoWStr;
            }

            //显示Intersection1的StoN车道信息
            StoNStr = "StoNLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[3].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                StoNStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection2Label4.InvokeRequired)
            {
                this.LaneIntersection2Label4.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection2Label4.Text = StoNStr;
                }));
            }
            else
            {
                this.LaneIntersection2Label4.Text = StoNStr;
            }






            /***********第三个路口**************/
            //显示Intersection1的WtoE车道信息
            LaneTemp = MainData.CEIntersectionList[2].GetEnterIntLaneList();
            VehicleTemp = LaneTemp[0].GetVehicleList();

            //用于给Label显示车辆信息字符串
            NtoSStr = "NtoSLane:\r\n\r\nCarID       CSID\r\n";
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                NtoSStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection3Label1.InvokeRequired)
            {
                this.LaneIntersection3Label1.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection3Label1.Text = NtoSStr;
                }));
            }
            else
            {
                this.LaneIntersection3Label1.Text = NtoSStr;
            }


            //显示Intersection1的WtoE车道信息
            WtoEStr = "WtoELane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[1].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                WtoEStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection3Label2.InvokeRequired)
            {
                this.LaneIntersection3Label2.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection3Label2.Text = WtoEStr;
                }));
            }
            else
            {
                this.LaneIntersection3Label2.Text = WtoEStr;
            }


            //显示Intersection1的EtoW车道信息
            EtoWStr = "EtoWLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[2].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                EtoWStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection3Label3.InvokeRequired)
            {
                this.LaneIntersection3Label3.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection3Label3.Text = EtoWStr;
                }));
            }
            else
            {
                this.LaneIntersection3Label3.Text = EtoWStr;
            }

            //显示Intersection1的StoN车道信息
            StoNStr = "StoNLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[3].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                StoNStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection3Label4.InvokeRequired)
            {
                this.LaneIntersection3Label4.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection3Label4.Text = StoNStr;
                }));
            }
            else
            {
                this.LaneIntersection3Label4.Text = StoNStr;
            }




            /***********第四个路口**************/
            //显示Intersection1的WtoE车道信息
            LaneTemp = MainData.CEIntersectionList[3].GetEnterIntLaneList();
            VehicleTemp = LaneTemp[0].GetVehicleList();

            //用于给Label显示车辆信息字符串
            NtoSStr = "NtoSLane:\r\n\r\nCarID       CSID\r\n";
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                NtoSStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection4Label1.InvokeRequired)
            {
                this.LaneIntersection4Label1.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection4Label1.Text = NtoSStr;
                }));
            }
            else
            {
                this.LaneIntersection4Label1.Text = NtoSStr;
            }


            //显示Intersection1的WtoE车道信息
            WtoEStr = "WtoELane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[1].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                WtoEStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection4Label2.InvokeRequired)
            {
                this.LaneIntersection4Label2.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection4Label2.Text = WtoEStr;
                }));
            }
            else
            {
                this.LaneIntersection4Label2.Text = WtoEStr;
            }


            //显示Intersection1的EtoW车道信息
            EtoWStr = "EtoWLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[2].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                EtoWStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection4Label3.InvokeRequired)
            {
                this.LaneIntersection4Label3.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection4Label3.Text = EtoWStr;
                }));
            }
            else
            {
                this.LaneIntersection4Label3.Text = EtoWStr;
            }

            //显示Intersection1的StoN车道信息
            StoNStr = "StoNLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[3].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                StoNStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection4Label4.InvokeRequired)
            {
                this.LaneIntersection4Label4.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection4Label4.Text = StoNStr;
                }));
            }
            else
            {
                this.LaneIntersection4Label4.Text = StoNStr;
            }





            /***********第五个路口**************/
            //显示Intersection1的WtoE车道信息
            LaneTemp = MainData.CEIntersectionList[4].GetEnterIntLaneList();
            VehicleTemp = LaneTemp[0].GetVehicleList();

            //用于给Label显示车辆信息字符串
            NtoSStr = "NtoSLane:\r\n\r\nCarID       CSID\r\n";
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                NtoSStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection5Label1.InvokeRequired)
            {
                this.LaneIntersection5Label1.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection5Label1.Text = NtoSStr;
                }));
            }
            else
            {
                this.LaneIntersection5Label1.Text = NtoSStr;
            }


            //显示Intersection1的WtoE车道信息
            WtoEStr = "WtoELane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[1].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                WtoEStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection5Label2.InvokeRequired)
            {
                this.LaneIntersection5Label2.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection5Label2.Text = WtoEStr;
                }));
            }
            else
            {
                this.LaneIntersection5Label2.Text = WtoEStr;
            }


            //显示Intersection1的EtoW车道信息
            EtoWStr = "EtoWLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[2].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                EtoWStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection5Label3.InvokeRequired)
            {
                this.LaneIntersection5Label3.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection5Label3.Text = EtoWStr;
                }));
            }
            else
            {
                this.LaneIntersection5Label3.Text = EtoWStr;
            }

            //显示Intersection1的StoN车道信息
            StoNStr = "StoNLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[3].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                StoNStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection5Label4.InvokeRequired)
            {
                this.LaneIntersection5Label4.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection5Label4.Text = StoNStr;
                }));
            }
            else
            {
                this.LaneIntersection5Label4.Text = StoNStr;
            }






            /***********第六个路口**************/
            //显示Intersection1的WtoE车道信息
            LaneTemp = MainData.CEIntersectionList[5].GetEnterIntLaneList();
            VehicleTemp = LaneTemp[0].GetVehicleList();

            //用于给Label显示车辆信息字符串
            NtoSStr = "NtoSLane:\r\n\r\nCarID       CSID\r\n";
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                NtoSStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection6Label1.InvokeRequired)
            {
                this.LaneIntersection6Label1.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection6Label1.Text = NtoSStr;
                }));
            }
            else
            {
                this.LaneIntersection6Label1.Text = NtoSStr;
            }


            //显示Intersection1的WtoE车道信息
            WtoEStr = "WtoELane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[1].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                WtoEStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection6Label2.InvokeRequired)
            {
                this.LaneIntersection6Label2.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection6Label2.Text = WtoEStr;
                }));
            }
            else
            {
                this.LaneIntersection6Label2.Text = WtoEStr;
            }


            //显示Intersection1的EtoW车道信息
            EtoWStr = "EtoWLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[2].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                EtoWStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection6Label3.InvokeRequired)
            {
                this.LaneIntersection6Label3.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection6Label3.Text = EtoWStr;
                }));
            }
            else
            {
                this.LaneIntersection6Label3.Text = EtoWStr;
            }

            //显示Intersection1的StoN车道信息
            StoNStr = "StoNLane:\r\n\r\nCarID       CSID\r\n";
            VehicleTemp = LaneTemp[3].GetVehicleList();
            for (int i = 0; i < VehicleTemp.Count; i++)
            {
                Vehicle v = VehicleTemp[i];
                StoNStr += v.Get_ID() + "    \"" + v.Get_SectionID() + "\"\r\n";
            }
            if (this.LaneIntersection6Label4.InvokeRequired)
            {
                this.LaneIntersection6Label4.Invoke(new MethodInvoker(delegate
                {
                    this.LaneIntersection6Label4.Text = StoNStr;
                }));
            }
            else
            {
                this.LaneIntersection6Label4.Text = StoNStr;
            }
            
        }
        

        //显示车道权值
        private void ShowLaneWeight() 
        {
            //判断交通云是否已经对权值进行更换
            if (MainData.TrafficCloud.GetStep() == 2) 
            {
                //显示权值
                double[,] WeightMatrix = MainData.TrafficCloud.GetWeightMatrix();
                //CurrentSpeedLabel1;
                //CurrentSpeedLabel2;
                //CurrentSpeedLabel3;        
                //CurrentSpeedLabel4;       
                //CurrentSpeedLabel5;    
                //CurrentSpeedLabel6;
                //CurrentSpeedLabel7;                       
                //CurrentSpeedLabel8;

                /*更新车辆信息标签*/
                if (this.CurrentSpeedLabel9.InvokeRequired)
                {
                    this.CurrentSpeedLabel9.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel9.Text = Math.Round(WeightMatrix[1, 0], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel9.Text = Math.Round(WeightMatrix[1, 0], 4).ToString();
                }



                if (this.CurrentSpeedLabel10.InvokeRequired)
                {
                    this.CurrentSpeedLabel10.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel10.Text = Math.Round(WeightMatrix[0, 1], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel10.Text = Math.Round(WeightMatrix[0, 1], 4).ToString();
                }




                if (this.CurrentSpeedLabel11.InvokeRequired)
                {
                    this.CurrentSpeedLabel11.Invoke(new MethodInvoker(delegate
                    {

                        this.CurrentSpeedLabel11.Text = Math.Round(WeightMatrix[2, 1], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel11.Text = Math.Round(WeightMatrix[2, 1], 4).ToString();
                }


                if (this.CurrentSpeedLabel12.InvokeRequired)
                {
                    this.CurrentSpeedLabel12.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel12.Text = Math.Round(WeightMatrix[1, 2], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel12.Text = Math.Round(WeightMatrix[1, 2], 4).ToString();
                }
               
                
                  
                //CurrentSpeedLabel13;       
                //CurrentSpeedLabel14;     

                if (this.CurrentSpeedLabel15.InvokeRequired)
                {
                    this.CurrentSpeedLabel15.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel15.Text = Math.Round(WeightMatrix[0, 3], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel15.Text = Math.Round(WeightMatrix[0, 3], 4).ToString();
                }


                if (this.CurrentSpeedLabel16.InvokeRequired)
                {
                    this.CurrentSpeedLabel16.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel16.Text = Math.Round(WeightMatrix[3, 0], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel16.Text = Math.Round(WeightMatrix[3, 0], 4).ToString();
                }



                if (this.CurrentSpeedLabel17.InvokeRequired)
                {
                    this.CurrentSpeedLabel17.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel17.Text = Math.Round(WeightMatrix[1, 4], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel17.Text = Math.Round(WeightMatrix[1, 4], 4).ToString();
                }


                if (this.CurrentSpeedLabel18.InvokeRequired)
                {
                    this.CurrentSpeedLabel18.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel18.Text = Math.Round(WeightMatrix[4, 1], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel18.Text = Math.Round(WeightMatrix[4, 1], 4).ToString();
                }


                if (this.CurrentSpeedLabel19.InvokeRequired)
                {
                    this.CurrentSpeedLabel19.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel19.Text = Math.Round(WeightMatrix[2, 5], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel19.Text = Math.Round(WeightMatrix[2, 5], 4).ToString();
                }


                if (this.CurrentSpeedLabel20.InvokeRequired)
                {
                    this.CurrentSpeedLabel20.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel20.Text = Math.Round(WeightMatrix[5, 2], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel20.Text = Math.Round(WeightMatrix[5, 2], 4).ToString();
                }   
                //CurrentSpeedLabel21;        
                //CurrentSpeedLabel22;    
                if (this.CurrentSpeedLabel23.InvokeRequired)
                {
                    this.CurrentSpeedLabel23.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel23.Text = Math.Round(WeightMatrix[4, 3], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel23.Text = Math.Round(WeightMatrix[4, 3], 4).ToString();
                }



                if (this.CurrentSpeedLabel24.InvokeRequired)
                {
                    this.CurrentSpeedLabel24.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel24.Text = Math.Round(WeightMatrix[3, 4], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel24.Text = Math.Round(WeightMatrix[3, 4], 4).ToString();
                }



                if (this.CurrentSpeedLabel25.InvokeRequired)
                {
                    this.CurrentSpeedLabel25.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel25.Text = Math.Round(WeightMatrix[5, 4], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel25.Text = Math.Round(WeightMatrix[5, 4], 4).ToString();
                }




                if (this.CurrentSpeedLabel26.InvokeRequired)
                {
                    this.CurrentSpeedLabel26.Invoke(new MethodInvoker(delegate
                    {
                        this.CurrentSpeedLabel26.Text = Math.Round(WeightMatrix[4, 5], 4).ToString();
                    }));
                }
                else
                {
                    this.CurrentSpeedLabel26.Text = Math.Round(WeightMatrix[4, 5], 4).ToString();
                }          
                //CurrentSpeedLabel27;      
                //CurrentSpeedLabel28;        
                //CurrentSpeedLabel29;        
                //CurrentSpeedLabel30;      
                //CurrentSpeedLabel31;       
                //CurrentSpeedLabel32;        
                //CurrentSpeedLabel33;
                //CurrentSpeedLabel34;
            }
            
        }


        /************************************************************************/
        /* 选择车辆，以供显示                                                                     */
        /************************************************************************/
        private void DisplayPanel_MouseMove(object sender, MouseEventArgs e)
        {


            //找到鼠标移动到了哪个车辆之上
            lock (this.Coordinates_i)
            {
                int Index = 0;
                if (this.Coordinates_i != null && this.Coordinates_i.Count != 0)
                {
                     for (Index = 0; Index < this.Coordinates_i.Count; Index++)
                        {
                            int Max_X = -1, Min_X = 9999;
                            int Max_Y = -1, Min_Y = 9999;
                            for (int i = Definitions.FrontMiddle; i <= Definitions.BackRight; i++)
                            {
                                if ((Max_X - this.Coordinates_i.ElementAt(Index).X[i]) < 0.0000000001)
                                {
                                    Max_X = (int)(this.Coordinates_i.ElementAt(Index).X[i]);
                                }
                                if ((Max_Y - this.Coordinates_i.ElementAt(Index).Y[i]) < 0.0000000001)
                                {
                                    Max_Y = (int)(this.Coordinates_i.ElementAt(Index).Y[i]);
                                }
                                if ((Min_X - this.Coordinates_i.ElementAt(Index).X[i]) > 0.0000000001)
                                {
                                    Min_X = (int)(this.Coordinates_i.ElementAt(Index).X[i]);
                                }
                                if ((Min_Y - this.Coordinates_i.ElementAt(Index).Y[i]) > 0.0000000001)
                                {
                                    Min_Y = (int)(this.Coordinates_i.ElementAt(Index).Y[i]);
                                }
                            }
                            if ((e.X - Min_X) > 0.0000000001f && (e.Y - Min_Y) > 0.0000000001f && (e.X - Max_X) < 0.0000000001f && (e.Y - Max_Y) < 0.0000000001f)
                            {
                                this.isSelectedVehicleInQueue = true;
                                string tempCurSelectedID = this.Coordinates_i.ElementAt(Index).ID;
                                if (tempCurSelectedID != this.CurSelectedID)
                                {
                                    this.PreSelectedID = this.CurSelectedID;
                                    this.CurSelectedID = tempCurSelectedID;
                                }
                                break;
                               // System.Console.WriteLine(e.X+" "+e.Y);
                            }
                        }
                   
                }
            }     
           
        }

        /// <summary>
        /// 查询选中的是哪个Intersection
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectIntersectionClick(object sender, MouseEventArgs e)
        {
            //Point p = e.
            //System.Console.WriteLine("X = " + e.X);
            //System.Console.WriteLine("Y = " + e.Y);

            //判断点击位置属于哪个Intersection
            int TempStandard = 935;
            int length = (int)(e.X / TempStandard);
            int height = (int)(e.Y / TempStandard);

            this.CurSelectedIntersection = height * 3 + length;


            //定时器开启
            this.PictureTimer.Start();
            this.PictureCountTime = 0;
        }

        //Intersection特效显示时长
        private void PictureTimer_Tick(object sender, EventArgs e)
        {

            PictureCountTime += 1;

            if (PictureCountTime >= 3)
            {                
               

                //this.pictureBox1.Visible = false;
            }
            else
            {
                
                //this.pictureBox1.Visible = true;
            }
        }

        //点击事件
        private void Menu3LayerItem1_MouseDown(object sender, EventArgs e) 
        {
            new AboutSoftware().Show();
        }

        //点击事件
        private void Menu3LayerItem2_MouseDown(object sender, EventArgs e)
        {
            new AboutUs().Show();
        }


    }
}
